为什么 OraOLEDB.Oracle GetRecordSet() 会抛出“ORA-00907:缺少右括号”?错误?
不幸的是,我正在开发一个旧的 VB6 应用程序,该应用程序正在构建一个巨大的(11902 个字符)临时 SQL 语句,然后将其传递给我的 DBConnection 的 GetRecordSet() 方法。该应用程序正在使用 OraOLEDB.Oracle 提供程序。但是,当执行 GetRecordSet() 方法时,我收到以下错误:
ORA-00907: 缺少右括号
现在我已经获取了传递给 GetRecordSet() 函数的字符串的内容,并彻底检查了它,并且在那里没有缺少父母。此外,我能够毫无困难地在 Oracle SQL Developer 和 SQL*Plus 中执行 select 语句。所以我确信该字符串在语法上是正确的。
我开始怀疑提供者中发生了一些可疑的事情 - 也许字符串太长并且在某处被截断?
有人可以帮我吗?
谢谢, 史蒂夫
I am unfortunately working on an old VB6 app that is constructing a huge (11902 characters) ad-hoc SQL statement which is then passed to the GetRecordSet() method of my DBConnection. The app is using the OraOLEDB.Oracle provider. When the GetRecordSet() method is executed, however, I get the following error:
ORA-00907: missing right parenthesis
Now I have grabbed the contents of the string that is passed in to the GetRecordSet() function and have thoroughly examined it and there are no missing parens. Additionally, I am able to execute the select statement in Oracle SQL Developer as well as SQL*Plus, withou difficulty. So I am sure that the string is syntactically correct.
I am beginning to suspect that something fishy is happening in the provider - perhaps the string is too long and it is getting truncated somewhere?
Can anyone out there help me out?
Thanks,
Steve
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查 oracle 跟踪文件。
首先将会话设置为跟踪模式:
更改会话设置 sql_trace = true;
并在同一会话中运行您的查询。您可以在数据库服务器上 user_dump_dest 指向的目录中找到跟踪文件。
如果查询完全在跟踪文件中,则它已被数据库完全接收。
Check the oracle trace file.
First set your session in trace mode:
Alter session set sql_trace = true;
And run your query in the same session. You can find the trace file on the database server in the directory pointed to by the user_dump_dest.
If the query is completely in the trace file, it has been completely received by the database.