I created a simple in sqlserver2005 stored procedure:
The ALTER procedure [dbo] [sp_cxxh] (@ xm nvarchar (10), @ xh nvarchar (10) the output)
As
Select @ xh=student id from xsxx_zzy where name=@ xm
Then in the used test:
Declare @ xh nvarchar (10)
The exec sp_cxxh 'zhang' @ xh OUTPUT
Print @ xh
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The stored procedure can get the return value: 10021 certification is correct,
Then I write the following code in the pb:
String ls_xh, ls_xm
Ls_xm='zhang'
DECLARE lpro_test PROCEDURE FOR sp_cxxh (ls_xm, : ls_xh OUTPUT);//plan a
//DECLARE lpro_test PROCEDURE FOR sp_cxxh @ xm=: ls_xm, @ xh=: ls_xh OUTPUT using the sqlca.//2
The EXECUTE lpro_test;
The Fetch lpro_test INTO: ls_xh;
Messagebox (" ", string (ls_xh))
I use ODBC interface, no problem with the database connection, no matter use plan a, or 2 are not return a value, please give directions!