如题,有一个函数function aa(ain varchar2,b out varchar2)
想在存储过程中调用该函数,并输出该函数的输出参数b,应该如何写?
------解决方案--------------------
- SQL code
delcarerin varchar2(100);rout varchar2(100);re number;--假设的你的函数返回此类型begin re := aa(rin,rout); dbms_output.put_line(rout);end;/
------解决方案--------------------
------解决方案--------------------
举例:
SQL> create or replace procedure p is
2 c varchar2(100);
3 begin
4 c := aa('ACCOUNTING',c);
5 dbms_output.put_line(c);
6 end;
7 /
Procedure created
SQL> create or replace function aa(a in varchar2,b out varchar2)
2 return varchar2 is
3 begin
4 select LOC into b from dept where dname = a;
5 return b;
6 end;
7 /
Function created
SQL> exec p;
NEW YORK
PL/SQL procedure successfully completed