我写了一个存储过程如下:
CREATE OR REPLACE Procedure insstandard( p_stdno IN ordersub.standno%type,
v_intTotale OUT int,
v_intViewNumber OUT int,
v_intPrintNumber OUT int,
v_intDownNumber OUT int,
p_ret OUT varchar(20))Begin
select sum(mount) into v_intTotale from ordersub o where o.standno ='p_stdno' AND status='1';
select sum(mount) into v_intViewNumber from ordersub o where o.standno ='p_stdno' AND mediumtype='0' AND status='1';
select sum(mount) into v_intPrintNumber from ordersub o where o.standno ='p_stdno' AND mediumtype='1' AND status='1';
select sum(mount) into v_intDownNumber from ordersub o where o.standno ='p_stdno' AND mediumtype='2' AND status='1';
COMMIT;
p_ret:= ‘Sucess!’;Exception
when others then
ROLLBACK;
p_ret := ‘fail’;
End;现要在JAVA中得到v_intTotale等四个值,怎么去调用这个存储过程,怎么才能得到我想要的四个值?
CREATE OR REPLACE Procedure insstandard( p_stdno IN ordersub.standno%type,
v_intTotale OUT int,
v_intViewNumber OUT int,
v_intPrintNumber OUT int,
v_intDownNumber OUT int,
p_ret OUT varchar(20))Begin
select sum(mount) into v_intTotale from ordersub o where o.standno ='p_stdno' AND status='1';
select sum(mount) into v_intViewNumber from ordersub o where o.standno ='p_stdno' AND mediumtype='0' AND status='1';
select sum(mount) into v_intPrintNumber from ordersub o where o.standno ='p_stdno' AND mediumtype='1' AND status='1';
select sum(mount) into v_intDownNumber from ordersub o where o.standno ='p_stdno' AND mediumtype='2' AND status='1';
COMMIT;
p_ret:= ‘Sucess!’;Exception
when others then
ROLLBACK;
p_ret := ‘fail’;
End;现要在JAVA中得到v_intTotale等四个值,怎么去调用这个存储过程,怎么才能得到我想要的四个值?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货