SQL Server stored prcedures with output parameters

Steve Holden steve at holdenweb.com
Thu Nov 18 00:45:33 EST 2004


Has anyone, with any driver whatsoever, managed to retrieve output 
parameters from a SQL Server stored procedure? I've just been rather 
embarrassed to find out it's not as easy as it might seem, and people 
are saying bad things about Python as a result :-(

mx.ODBC, which I regard as a highly-capable module, does not support the 
callproc() API, and suggests use of the ODBC call format. It has caveats 
in (some of) the documentation implying that output parameters cannot be 
handled due to their indeterminate memory requirements, however.

The adodbapi module does have a stored procedure call in its unit tests, 
and manages to pass that test, but when I call my own stored procedure 
(which retrieves columns into the output parameters rather than using 
SET to establish their values) I get back whatever value I supplied as 
the output parameter rather than what the stored procedure is returning.

So, can anyone help me to fulfill what must be a very common database 
requirement?

regards
  Steve
-- 
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119



More information about the Python-list mailing list