--v_returncode是out参数
declare
v_out number;
begin
proc_GetAwardPrize(v_productid => 364,v_userid => 3,v_awardtype => 1,v_returncode => v_out);
DBMS_OUTPUT.PUT_LINE('v_out='||v_out);
end;
以下是存储过程:
create or replace procedure proc_GetAwardPrize(v_productid number,v_userid number,v_awardtype number,v_returncode out number) is
v_awardid prd_award.awardid%type;
v_awardlevel pub_typeinfo.name%type;
v_cost prd_award.awardcost%type;
v_name prd_award.awardname%type;
v_flag prd_award.flag%type;
v_temp pub_typeinfo.name%type;
cursor award_cursor is
select awardid,awardcost,awardname,flag from prd_award where status=1 and piid=v_productid and awardtype=v_awardtype;
begin
open award_cursor;
loop
fetch award_cursor into v_awardid,v_cost,v_name,v_flag;
exit when award_cursor%notfound;
v_awardl