on 2023 Apr 07 4:47 AM
We want to write a downloaded file with scripting to a folder on the client machine. But the procedure write_client_file() seems to be missing. Has it been replaced? Has it something to do with having the proper rights. The function is mentioned in the help files and I would expect that the function would be available. The error we get:
Could not execute statement. Procedure 'write_client_file' not found SQLCODE=-265, ODBC 3 State="42S02"
That function should not be 'CALL'ed. It should be executed either as SELECT or via a SET var =. Here is an example:
set temporary option allow_write_client_file = 'on'; // permit write_client_file for current connection select write_client_file( 'c:\\temp\\write_client_file.txt', 'Testing write_client_file with SELECT' ); set retval = write_client_file( 'c:\\temp\\write_client_file2.txt', 'Testing write_client_file with SET' ); -- but this will report Procedure 'write_client_file' not found call write_client_file( 'c:\\temp\\write_client_file3.txt', 'Testing write_client_file with CALL'
It is also possible to further secure the feature with -sf.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the documentation for write_client_file here. You need to ensure a number of privileges have been enabled/set before using this function.
Also, you must be using a client API that uses the CmdSeq protocol (ODBC, dblib). If you are using any of the other APIs then this function cannot be used. What client API are you using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From a client application we call a stored procedure where we want to pass the location where to store the file on the client. The procedure first downloads a binary file using a web service and then needs to store it on the passed location on the client. The client application is a windows application that uses the ODBC driver to connect to the database.
That should work but when the client file read/write is issued within a stored procedure (in contrast to via directly from the client code), it requires a particular ODBC callback, see here, in addition to the required privilege.
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.