存储过程简单语法

存储过程语法1

 

create or replace procedure judge(a outnumber) as

  cn number(4);

begin

  select count(*) into cn from dual;

  if cn = 0then

    begin

      dbms_output.put_line('aa');

    end;

  endif;

  if cn = 1 then

    begin

      a := cn;

      dbms_output.put_line('bb');

    end;

  end if;

exception

  when others then

    rollback;

end;

 

 

 

 

 

 

存储过程语法2:

 

create or replace procedure judge3(a outnumber) as

  cn number(4);

begin

  select count(*) into cn from dual;

  if cn = 0 then

      dbms_output.put_line('aa');

 else

      a := cn;

      dbms_output.put_line('bb');

  end if;

exception

  when others then

    rollback;

end;

猜你喜欢

转载自dxl-xiaoli.iteye.com/blog/2009822