I use python and sqlalchemy but pd.read_ sql_ query is so slow so I try to write the data in csv file in my procedure with unload statment to cleint then i want to use pd.read_scv UNLOAD TABLE #table INTO CLIENT FILE 'c:\tmp\test_data.csv; i get error messages 'Client application does not allow data to be written to this file ' in pyhon code from sqlalchemy Thanks for the help in advance |
Try this: http://dcx.sap.com/index.html#sqla170/en/html/812c36fb6ce21014a20ae7873e5607d0.html There are times when a callback is required though (such as when the UNLOAD is in a stored procedure) and you won't be able to do that from python, I don't think. See DB_CALLBACK_VALIDATE_FILE_TRANSFER at http://dcx.sap.com/index.html#sqla170/en/html/3bd12e6c6c5f1014b9d2d85be55df0a4.html Thanks, there is any possibility in my procedure to give the authority (DB_CALLBACK_VALIDATE_FILE_TRANSFER ) in my procedure I wrote: SET OPTION allow_write_client_file = 'On';
(27 Nov '19, 05:11)
salwa
Replies hidden
You probably want 'SET TEMPORARY OPTION'... since SET OPTION is actually an operation that gets logged. Setting the option is different from providing a validation callback. The callback is code provided at the client that allows the application to permit or reject client file transfers.
(27 Nov '19, 05:14)
John Smirnios
thanks, I also tried 'SET Temporary OPTION allow_write_client_file =' On ';' the message from interactive sql is: "has a procedure or trigger calls to write in file allow this transfer refuse this exaggeration " and in paython code The client application does not allow the transmission of data initiated by the server. To allow the transmission of data initiated by the server, the application must register a validation callback mechanism in the client library.
(02 Dec '19, 05:07)
salwa
Replies hidden
The point is you need to register the callback (which seems not to be possible with SQL Anywhere's Python support) when the client read is initiated by the server, see the doc topic cited by John:
In other words: A simple UNLOAD statement (like the sample shown in your question) issued by the client should not require a registered callback and as such should work from Python. At least that's my understanding.
(02 Dec '19, 06:55)
Volker Barth
|
When Python does not support to allow the required callback, is there a chance you could use a DBISQL client instead? DBISQL will ask the client to allow client-side read/write operations...