【问题标题】:oracle apex input errororacle 顶点输入错误
【发布时间】:2014-05-06 17:47:46
【问题描述】:
hello i am trying to read something from the keyboard using the "&". like this:
 declare
x number;
begin
x := &enter_value;
dbms_output.put_line(x*2);
end;
/

我收到此错误:

ORA-06550:第 4 行,第 6 列: PLS-00103:在预期以下情况之一时遇到符号“&”:

   ( - + case mod new not null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable>
   continue avg count current exists max min prior sql stddev
   sum variance execute forall merge time timestamp interval
   date <a string literal with character set specification>
   <a number> <a single-quoted SQL string> pipe
   <an alternatively-quoted string literal with character set specifi


2. x number;
3. begin
4. x := &enter_value;
5. dbms_output.put_line(x*2);
6. end;

我正在使用在线 apex:apex.oracle.com

【问题讨论】:

  • 您是在 Oracle Apex 中使用 Application Builder 还是 SQL Workshop?
  • 我正在使用 sql wokshop
  • & 不是 PL/SQL 语法的一部分,它通常用于提供替换字符串(例如,您可以在 Apex 应用程序或 SQL*Plus 脚本中使用 &amp;ITEMNAME.)。我认为 SQL Workshop 不承认它。

标签: sql oracle oracle-apex


【解决方案1】:

绑定变量语法取决于您使用的应用程序。您尝试使用的 & 符号语法 (&enter_value) 与 SQL Developer 相关联,而不是与 SQL Workshop 相关联。

如果您将代码复制并粘贴到 SQL Developer 中,它应该可以工作。 (注意:有时你必须用引号括起来,例如'&amp;enter_value')。

我不知道在 SQL Workshop 中使用替换字符串的任何方法。

【讨论】:

    猜你喜欢
    • 2016-05-28
    • 2019-06-26
    • 2021-12-22
    • 1970-01-01
    • 1970-01-01
    • 2015-01-29
    • 2020-05-28
    • 2021-04-01
    • 1970-01-01
    相关资源
    最近更新 更多