【问题标题】:Oracle - replacing & with OEM_sqlplus_input_finished in select queryOracle - 在选择查询中用 OEM_sqlplus_input_finished 替换 &
【发布时间】:2011-08-19 19:09:44
【问题描述】:
select * from tableName where somecode = '$$$$$$$&8Y~$$$$'

当我在 SQLPlus Worksheet 中运行此查询时,我得到如下输出:

输入 8y 的值:old 2: And somecode = '$$$$$$$&8Y~$$$$') 新 2: 还有一些代码 = '$$$$$$$OEM_sqlplus_input_finished~$$$$')

没有选择行

我的问题是,如果使用 OracleConnection 和 OracleCommand(命令类型为文本)从 ASP.NET 应用程序执行此查询,它会作为查询 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)

【问题讨论】:

    标签: asp.net oracle plsql


    【解决方案1】:

    以 & 开头的变量替换是 SQL*plus 提供的一项功能。它既不是 SQL 也不是 PL/SQL。 SQL Developer 实现了大多数这些 SQL*plus 扩展。

    因此,在您的 .NET 应用程序中,与号没有特殊含义。

    您也可以在 SQL*plus 和 SQL Developer 中通过执行以下命令将其关闭:

    SET DEF OFF
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-08
      • 1970-01-01
      • 1970-01-01
      • 2021-09-27
      • 1970-01-01
      • 1970-01-01
      • 2016-05-19
      • 1970-01-01
      相关资源
      最近更新 更多