cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SQL Anywhere 17 build 6933 missing write_client_file() function

fvestjens
Participant
0 Likes
2,713

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"

View Entire Topic
chris_keating
Product and Topic Expert
Product and Topic Expert

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.