萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> sql server教程 >> 如何取得MSSQL中的存儲過程的返回值

如何取得MSSQL中的存儲過程的返回值

聲明存儲過程
CREATE PROCEDURE sp_results_demo @InParmInt Int,@OutParmInt OUTPUT
AS
BEGIN
SELECT 1,2,3,4
SELECT uid,id
FROM sysobjects
WHERE type='U'采集我?NKC5o

SELECT @OutParmInt=69采集我?NKC5o

Return 16
END
用於返回每個返回值時用PowerScrip如下:
Long lReturn,lPram1,lPram2,lResult1,lResult2,lResult3,lResult4,lResult5,lResult6采集我?NKC5o

DECLARE results_demo PROCEDURE FOR
@returnValue=sp_results_demo
@InParmInt = :lPram1,
@OutParmInt = :lPram2 OUTPUT using sqlca;采集我?NKC5o

execute results_demo;采集我?NKC5o

Do While SQLCA.SQLCode=0
Fetch results_demo INTO :lResult1,:lResult2,:lResult3,:lResult4 ;
Loop采集我?NKC5o

Fetch results_demo INTO :lResult5,:lResult6 ;采集我?NKC5o

Do While sqlca.sqlcode=0
Fetch results_demo Into :lResult5,:lResult6;
Loop采集我?NKC5o

Fetch results_demo Into :lReturn,:lPram2;采集我?NKC5o

Close results_demo ;采集我?NKC5o


愛好者 [email protected]采集我?NKC5o

mail to :[email protected]采集我?NKC5o

 采集我?NKC5o


關鍵詞:

copyright © 萬盛學電腦網 all rights reserved