17,082
社区成员
发帖
与我相关
我的任务
分享
create or replace function f_test1
(i_aa test3.aa%type,
i_bb test3.bb%type
)
return varchar2
is
v_result varchar2(20);
count_1 number;
begin
select t3.cc into v_result from test3 t3
where
t3.aa = i_aa
and t3.bb = i_bb
;
return v_result;
exception
when others then
return '1010';
end f_test1;
u1@EMREP> select * from test3;
AA BB CC
---------- ---------- ----------
1 2 3
u1@EMREP> call f_test1(1,1) into :a;
Call completed.
u1@EMREP> print a;
A
----------
1010
u1@EMREP> call f_test1(1,2) into :a;
Call completed.
u1@EMREP> print a;
A
----------
3