声明存储过程
create procedure sp_results_demo @inparmint int,@outparmint output
as
begin
select 1,2,3,4
select uid,id
from sysobjects
where type='u'
select @outparmint=69
return 16
end
用于返回每个返回值时用powerscrip如下:
long lreturn,lpram1,lpram2,lresult1,lresult2,lresult3,lresult4,lresult5,lresult6
declare results_demo procedure for
@returnvalue=sp_results_demo
@inparmint = :lpram1,
@outparmint = :lpram2 output using sqlca;
execute results_demo;
do while sqlca.sqlcode=0
fetch results_demo into :lresult1,:lresult2,:lresult3,:lresult4 ;
loop
fetch results_demo into :lresult5,:lresult6 ;
do while sqlca.sqlcode=0
fetch results_demo into :lresult5,:lresult6;
loop
fetch results_demo into :lreturn,:lpram2;
close results_demo ;
爱好者 [email protected]
mail to :[email protected]