cancel
Showing results for 
Search instead for 
Did you mean: 

Output to File

Former Member
2,138

Guys,

I'm having trouble trying to output the the table to a file:

IF (NumRows > 0 ) THEN
MESSAGE 'We have not had backups for more than 2 hours! Affected volumes are: ';
SELECT * FROM LatestBackup WHERE datediff (minute, ExecTime, getdate()) < 130;
OUTPUT TO '/dir1/dir2/textfile FORMAT TEXT;
END IF;


Such a code returns syntax error. While I'm executing SELECT and OUTPUT only, it works perfectly fine. Any ideas? Can't I use OUTPUT in a batch?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

MCMartin
Participant

OUTPUT is a command which can only be used in the tool dbisql, but you can use the UNLOAD command instead.

Former Member
0 Kudos

Yeah. Just found out the UNLOAD statement. Thank you!

VolkerBarth
Contributor

FWIW, as you have used the "output" tag yourself, that tag lists a whole bunch of FAQs and explanations to that topic:

http://sqlanywhere-forum.sap.com/tags/output/

Answers (0)