Hello,
I need some help getting output values from my stored procedures when
using adodbapi. There's an example
testVariableRet urningStoredPro cedure in adodbapitest.py , and that
works for my system. But my stored procedure also inserts and
accesses a table in the database. Here's what I have it boiled down
to:
So, when I have
CREATE PROCEDURE sp_DeleteMeOnly ForTesting
@theInput varchar(50),
@theOtherInput varchar(50),
@theOutput varchar(100) OUTPUT
AS
SET @theOutput=@the Input+@theOther Input
Then, I can run in python:
[u'hello', u'bye', u'hellobye']
If I redefined the procedure as
CREATE PROCEDURE sp_DeleteMeOnly ForTesting
@theInput varchar(50),
@theOtherInput varchar(50),
@theOutput varchar(100) OUTPUT
AS
SELECT * From dbo.testtable
SET @theOutput=@the Input+@theOther Input
Then, the python comes out as :
[u'hello', u'bye', u'']
My search on the web found a couple of posts with similar problems,
but no solutions. I am using SQLOLEDB.1 as Provider, connecting to
SQL Server 2005.
Any help appreciated. I just need one method of passing an output
parameter back to python.
Thanks,
Li
I need some help getting output values from my stored procedures when
using adodbapi. There's an example
testVariableRet urningStoredPro cedure in adodbapitest.py , and that
works for my system. But my stored procedure also inserts and
accesses a table in the database. Here's what I have it boiled down
to:
So, when I have
CREATE PROCEDURE sp_DeleteMeOnly ForTesting
@theInput varchar(50),
@theOtherInput varchar(50),
@theOutput varchar(100) OUTPUT
AS
SET @theOutput=@the Input+@theOther Input
Then, I can run in python:
>>cursor = db.conn.cursor( )
>>cursor.callpr oc('sp_DeleteMe OnlyForTesting' , ('hello', 'bye', ''))
>>cursor.callpr oc('sp_DeleteMe OnlyForTesting' , ('hello', 'bye', ''))
If I redefined the procedure as
CREATE PROCEDURE sp_DeleteMeOnly ForTesting
@theInput varchar(50),
@theOtherInput varchar(50),
@theOutput varchar(100) OUTPUT
AS
SELECT * From dbo.testtable
SET @theOutput=@the Input+@theOther Input
Then, the python comes out as :
>>cursor = db.conn.cursor( )
>>cursor.callpr oc('sp_DeleteMe OnlyForTesting' , ('hello', 'bye', ''))
>>cursor.callpr oc('sp_DeleteMe OnlyForTesting' , ('hello', 'bye', ''))
My search on the web found a couple of posts with similar problems,
but no solutions. I am using SQLOLEDB.1 as Provider, connecting to
SQL Server 2005.
Any help appreciated. I just need one method of passing an output
parameter back to python.
Thanks,
Li
Comment