在Apache derby Export_Query中包含变量的正确方法是什么 [英] What is the correct way to include a variable inside an Apache derby Export_Query
本文介绍了在Apache derby Export_Query中包含变量的正确方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将数据从德比表导出到文件中。我在 WHERE
子句中遇到问题。我有这个。
I am trying to export data from a derby table to a file. I'm having issues with the WHERE
clause. What I have is this.
s.execute("CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('SELECT *FROM REPORT WHERE DATE = " + conversion.getDate() + " ' , 'C:\\Pos\\daily_report.csv' , ',' , null, null)");
此例外
Java.sql.SQLSyntaxErrorException:语法错误:在
第1行第37列遇到 Sep。
Java.sql.SQLSyntaxErrorException: Syntax error: Encountered "Sep" at line 1, column 37.
有人可以为此指导我。
推荐答案
我找到了。
s.execute( CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('SELECT * FROM REPORT WHERE DATE ='' + conversion.getDate()+ ''','C:\Pos\daily_report.csv',',',null,null));
s.execute("CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('SELECT*FROM REPORT WHERE DATE = ' ' " + conversion.getDate() + " ' ' ' , 'C:\Pos\daily_report.csv' , ' , ' , null, null)");
这篇关于在Apache derby Export_Query中包含变量的正确方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文