SQL Anywhere v10 Syntax error near OUTPUT

岁酱吖の 提交于 2020-01-15 09:48:13

问题


I'm attempting to output a table to an outside file. I've found a few questions regarding this and followed the answers from there without any luck.

SELECT * FROM transactions; OUTPUT TO 'C:\Users\administrator\Desktop\Test.txt'

Is the statement I've been using, I've attempted different variations with formatting and file types such as .csv with no change.

Which produces:

ErrorCode : 102 SQLState : 42W04 Message : SQL Anywhere Error -131: Syntax error near 'OUTPUT' on line 1

SQL =

OUTPUT TO 'C:\Users\administrator\Desktop\Test.txt'

Appreciate all your help


回答1:


Are you running this through dbisql, or in a different application? OUTPUT TO is a dbisql command, not a SQL statement recognized by the database server. You can use the UNLOAD statement in any application to allow the server to create the file.

Disclaimer: I work for SAP in SQL Anywhere engineering.



来源:https://stackoverflow.com/questions/33677756/sql-anywhere-v10-syntax-error-near-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!