The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

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
8.6k114149237
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:

×24
×20
×7

question asked: 17 Apr '14, 06:09

question was seen: 408 times

last updated: 17 Apr '14, 06:53