create or replace procedure1(l_nothing varchar2)
as
begin
if l_nothing := procedure_2 then
exec procedure_2(2);
else l_nothing := NULL
dbms.output_put_line(l_nothing);
end if;
end;
/
create or replace procedure2(l_id in varchar2)
return NUMBER is l_name NUMBER(9);
begin
select name into l_name from test where l_id =id;
return l_name;
end;
/
能否让o存储过程用if语句执行另一个存储过程?
create or replace procedure1(l_nothing varchar2)
as
begin
if lower(l_nothing) = 'procedure2' then
procedure2(2);
else
dbms.output_put_line(l_nothing);
end if;
end;
过程没有返回任何值......所以,你需要把过程2改为函数或者在过程2中创建一个输出参数。