I need to know if this is possible. I need to create a new event that will execute a query and dump the results into a flat file. This event will be run in the middle of the night without any user intervention. What commands do I execute to achieve this? [edit] Rookie mistake; forgot to mention that this was for a version 8 or 9 database. |
The UNLOAD SELECT statement is your friend - I'm quite sure there are some examples and discussions on this facility (vs. OUTPUT, which won't work in procedures and events) in this forum. Just to add w.r.t. older versions: AFAIK, both events and the UNLOAD statement have been available since v7, so you're alright with v8/v9:) That works. Thanks a lot.
(24 Apr '12, 12:40)
Bwery
|
To dump query results to a flat file, I fire-up Sybase Central then connect to the DB. I then right-click on the connected database to run ISQL. I paste the query into ISQL and generate the result. Then select Data Export to save the result to a text file. Not sure about sa 8/9 compatibility. 1
That does work for interactive users, as does using Interactive SQL with the OUTPUT statement and its various data formats - both with v8/v9, too. Note, however, that this does not work well (err, not at all) for an automated event that has to run nightly:)
(25 Apr '12, 09:36)
Volker Barth
|