我有一个sybaseiq_file.sql文件,其中包含以下代码
begin
select col1,col2, ROW_NUMBER() OVER (PARTITION BY col3 ORDER BY col1) as v_order into #tmptbl from tbl
UNLOAD TABLE #tmptbl TO 'Vinoth.dat'
drop table #tmptbl
end
我想将select语句的输出推送到文件。
但是执行时出现以下错误。请帮助解决此问题。
dbisqlc -c "uid=XXX;pwd=XXX;eng=XXX;links=tcpip(host=XXX;port=XXX)" -q sybaseiq_file.sql
Error in file "sybase_fileiq.sql" at line 0
Syntax error near 'UNLOAD' on line 2
答案 0 :(得分:0)
使用下面的重写代码解决了该问题
begin
select col1,col2, ROW_NUMBER() OVER (PARTITION BY col3 ORDER BY col1) as v_order into #tmptbl from tbl
select * from #tmptbl ># 'Vinoth.dat'
drop table #tmptbl
end