SQL Server stored prcedures with output parameters

Steve Holden steve at holdenweb.com
Thu Nov 18 02:29:06 EST 2004


Steve Holden wrote:

> 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

Hmmm, following up, added another test to adodbapi to retrieve a value 
from a table into an output parameter it works, so this puts the 
suspicion on to the stored procedure. Since this was written by the 
client I'll take a look at it later (when I'm back in the office) and 
see what the problem might be.

happily-talking-away-to-myself-ly y'rs  - steve
-- 
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119



More information about the Python-list mailing list