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.oracle.com
1 回答
绑定变量语法取决于您正在使用的应用程序 . 您尝试使用的&符号语法(&enter_value)与SQL Developer相关联,而不是SQL Workshop .
如果将代码复制并粘贴到SQL Developer中,它应该可以正常工作 . (注意:有时您必须将其包装在引号中,例如
'&enter_value'
) .我不知道在SQL Workshop中使用替换字符串的方法 .