SQL> var test varchar2(100);
SQL> exec test := 'This is test!';begin test := 'This is test!'; end;ORA-06550: 第 1 行, 第 7 列: 
PLS-00201: 必须声明标识符 'TEST'
ORA-06550: 第 1 行, 第 7 列: 
PL/SQL: Statement ignored就是执行通不过
奇怪啊Release 10.2.0.1.0 

解决方案 »

  1.   


    SQL> declare
      2    test   varchar2(100);
      3  begin
      4    test   :=   'This   is   test!';
      5  end;
      6  /PL/SQL procedure successfully completedExecuted in 0 seconds
      

  2.   

    declare
     test varchar2(100);
    begin
     test := 'This is test!';
    end;
      

  3.   

    错在分行了.哈哈.
    没有办法认识到这个变量.他们的方法是写了一个sql/pl 块程序,
    你写的就是两个程序。赫赫。
    var   test   varchar2(100); 
    这样写,不表示,在你的sql/plus环境下面生成test变量。赫赫。两个句子之间不共享。
      

  4.   

    原来如此
    pl/sql是语句级的
    对吧
      

  5.   

    赫赫,这样说不对。上面的例子,就不是语句级别的。就是说,想写PL/SQL块的话,是有一定的语法规则的。赫赫。