create or replace procedure A is
begin
  if B('ok') then
    dbms_output.put_line('right');
  else 
    dbms_output.put_line('error');
  end if;
end;create or replace function B(str varchar2) return boolean is
begin
  return str='ok';  
end;

解决方案 »

  1.   

    to: CodeMagic(ErrorDetector)
    请问怎么用呢?给个语句 ?谢谢
      

  2.   

    方法一:使用函数create or replace procedure A is
      result boolean;
    begin
      reuslt:=B('ok');
      if result then
        dbms_output.put_line('right');
      else 
        dbms_output.put_line('error');
      end if;
    end;create or replace function B(str varchar2) return boolean is
    begin
      return str='ok';  
    end;方法二:使用带返回值的过程create or replace procedure A is
      result boolean;
    begin
      B('ok',result);
      if result then
        dbms_output.put_line('right');
      else 
        dbms_output.put_line('error');
      end if;
    end;create or replace procedure B(str varchar2,re out boolean) is
    begin
      re:=str='ok';  
    end;
      

  3.   

    可以使用你说的第一种方法进行过程的返回,如果你想使用 return 来进行返回,那就只能使用函数了.
      

  4.   

    在oracle中如果想得到过程返回的值,是不是必须通过过程的变量返回。
    但是在SQL SERVER 中有系统返回的值,不需要自定义变量也可得到返回的值。在这点上他们是不是有差别。
      

  5.   

    怎么没人回答?CodeMagic(ErrorDetector)不在了吗?算了给分了。