i just want to know the result from execute order,
for example:
i write:  begin XXX;  end;
here XXX is one procedurehow to return the result from sql:   begin XXX;  end;if the procedure XXX is right, result is null?
if the procedure XXX is wrong, what is the result?thanks

解决方案 »

  1.   

    例子:1、return返回值类型:
    declare v_return_value number;
    v_return_value := spname();
    dbms_output.putline(v_return_value);
    2、out返回
    declare v_return_value number;
    spname(:v_return_value);
    dbms_output.putline(v_return_value);  
      

  2.   

    用用户定义exception 。
    具体可以找本书 或找个例子看
    declare
         myexception exception;
        begin
         if1=0then
            raise myexception;
         endif; 
        exception
         when myexception then
            dbms_output.put_line('asdf');
        end; 
      

  3.   

    除了在procedure写dbms_output.put_line(....);
    还要设置显示output,在sqldeveloper->view->dbms output,然后在dbms output窗口add connection