如题:
在PL/SQL中,输入如下语句:
->SQL:Set Serveroutput On
->SQL:create or replace trigger Temp_bur
  before insert on temp  
  for each row
  begin
     dbms_output.put_line('bur old N:'||:old.n||' M:'||:old.M);
     dbms_output.put_line('BUR new N:'||:new.n||' M:'||:new.M);  
  end Temp_bur;->SQL:/执行第1行就出错了,报错如下:
ORA-00922:选项缺失或无效请教高手过来解答下。我想在PL/SQL里面把我想要的输出来:bur old N: 等等,另外问个菜鸟问题,如果能成功输出,会在哪里输出呢?

解决方案 »

  1.   

    这个是sqlplus命令,在plsql developer里没有
      

  2.   

    用plsql developer 的commond window 执行
      

  3.   

    在sqlplus中运行没有问题SQL> Set   Serveroutput   On
    SQL> create table temp(n int,m int);表已创建。SQL> create   or   replace   trigger   Temp_bur
      2      before   insert   on   temp
      3      for   each   row
      4      begin
      5            dbms_output.put_line( 'bur   old   N: '||:old.n|| '   M: '||:old.M);
      6            dbms_output.put_line( 'BUR   new   N: '||:new.n|| '   M: '||:new.M);
      7      end   Temp_bur;
      8  /触发器已创建SQL> insert into temp select 1,2 from dual;
    bur   old   N:    M:
    BUR   new   N: 1   M: 2已创建 1 行。SQL>
      

  4.   

    commad窗口吧.一般的sqlplus命令在command窗口执行没什么问题.
    autotrace,refcursor变量定义啥的只能用在sqlplus里.
      

  5.   


    非常感谢大家这么热心的帮助,我改用在commond window 执行就可以了。