Oracle - 替换&在选择查询中使用 OEM_sqlplus_input_finished
select * from tableName where somecode = '$$$$$$$&8Y~$$$$'
当我在 SQLPlus Worksheet 中运行此查询时,我得到如下输出:
输入 8y 的值:old 2: And somecode = '$$$$$$$&8Y~$$$$') 新 2: 和 somecode = '$$$$$$$OEM_sqlplus_input_finished~$$$$')
未选择任何行
我的问题是,如果使用 OracleConnection 和 OracleCommand 从 ASP.NET 应用程序执行此查询(命令类型为text),它会作为查询 1 或 2 执行吗?
1. select * from tableName where somecode = '$$$$$$$&8Y~$$$$'
2. select * from tableName where somecode = '$$$$$$$OEM_sqlplus_input_finished~$$$$'
如果以后是这种情况,我如何仅对当前 OracleConnection 会话禁用这样的参数替换(在关闭连接后恢复到任何状态)?
(这是旧的.NET 1.1应用程序,因此使用OracleConnection和OracleCommand)
select * from tableName where somecode = '$$$amp;8Y~$$'
when I ran this query in SQLPlus Worksheet, I get output like this:
Enter value for 8y: old 2: And somecode = '$$$$$$$&8Y~$$$$')
new 2: And somecode = '$$$$$$$OEM_sqlplus_input_finished~$$$$')no rows selected
My question is, if this query is executed as it is from ASP.NET application using OracleConnection and OracleCommand (Command type as text), will it get executed as query 1 or 2?
1. select * from tableName where somecode = '$$$amp;8Y~$$'
2. select * from tableName where somecode = '$$$$OEM_sqlplus_input_finished~$$'
If later is the case, how I disable parameter replacing like this for current OracleConnection session only (revert back to whatever it was after closing connection)?
(It is old .NET 1.1 application, so OracleConnection and OracleCommand are used)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
替换以与号 (&) 开头的变量是 SQL*plus 提供的功能。它既不是 SQL 也不是 PL/SQL。 SQL Developer 实现了大部分 SQL*plus 扩展。
因此,在 .NET 应用程序中,& 符号没有特殊含义。
您还可以通过执行以下命令在 SQL*plus 和 SQL Developer 中将其关闭:
The replacement of variables starting with an ampersand (&) is a functionality provided by SQL*plus. It's neither SQL nor PL/SQL. SQL Developer implements most of these SQL*plus extensions.
So, in your .NET application, the ampersand has no special meaning.
You can also turn it off in SQL*plus and SQL Developer by executing: