【发布时间】:2019-03-30 15:47:33
【问题描述】:
我正在使用 Oracle ODBC 驱动程序并希望动态传递变量。这就是我的查询的样子:
define val = 'Test';
select * from Table where Name = '&val'
虽然此查询在 Oracle SQL Developer 中运行良好,但我认为我没有为 ODBC 驱动程序编写正确执行的查询。有什么建议吗?
来自 ODBC 日志:
退出 SQLExecDirectW 并返回代码 -1 (SQL_ERROR) "define val = 'Test';\ aselect * from Table where Name = '&val';\ 0" DIAG [42000] [Oracle][ODBC][Ora]ORA-00900: SQL 语句无效
【问题讨论】: