oracle - 批处理(sql语句块)

格式:

View Code
 declare
   msg    varchar2(32);
   p_name varchar2(32);
   outresult varchar2(64);
 begin
   p_name := 'xxxx';
   select loginname into MSG from users where loginname = p_name and 1=2;
   dbms_output.put_line(MSG);
 exception
   when others then
     outresult := 'failure---' || sqlerrm || '   ' || p_name;
     dbms_output.put_line(outresult);
 end;

字符类型的变量必须声明其精度

posted on 2012-10-20 20:41  lovebeauty  阅读(3651)  评论(0编辑  收藏  举报

导航