Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oracle 这个程序有什么错误?_Oracle_Variables_Plsql_Sqlplus - Fatal编程技术网

Oracle 这个程序有什么错误?

Oracle 这个程序有什么错误?,oracle,variables,plsql,sqlplus,Oracle,Variables,Plsql,Sqlplus,我已编写以下pl/sql程序,无法检测错误: declare variable a number; b number:=2354; begin b:=:a; end; 这其中的错误是 SP2-0552:未声明绑定变量“A” plz help…变量是SQL*PLus关键字。因此,需要将其移到PL/SQL声明之外: SQL> variable a number; SQL> SQL> declare 2 b number:=2354; 3 begin

我已编写以下pl/sql程序,无法检测错误:

 declare
 variable a number;
 b number:=2354;
 begin
 b:=:a;
 end;
这其中的错误是

SP2-0552:未声明绑定变量“A”


plz help…

变量是SQL*PLus关键字。因此,需要将其移到PL/SQL声明之外:

SQL> variable a number;
SQL>
SQL> declare
  2      b number:=2354;
  3  begin
  4      :a := b;
  5  end;
  6  /

PL/SQL procedure successfully completed.

SQL>
SQL> print a

         A
----------
      2354

SQL>