on 2012 Apr 24 1:29 PM
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.
Request clarification before answering.
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:)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:)
User | Count |
---|---|
52 | |
10 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.