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.

asked 17 Apr '14, 06:09

Maciej's gravatar image

Maciej
1715514
accept rate: 0%


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

permanent link

answered 17 Apr '14, 06:27

Martin's gravatar image

Martin
9.0k130166257
accept rate: 14%

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

(17 Apr '14, 06:28) Maciej
Replies hidden
2

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/

(17 Apr '14, 06:53) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×28
×22
×5

question asked: 17 Apr '14, 06:09

question was seen: 1,802 times

last updated: 17 Apr '14, 06:53