RE: SQL Server stored prcedures with output parameters
From: Tim Golden (tim.golden_at_viacom-outdoor.co.uk)
Date: 11/18/04
- Next message: Andrew James: "TPG error when using 't' as the first letter of a token"
- Previous message: Antoon Pardon: "Re: Will python ever have signalhandlers in threads?"
- Maybe in reply to: Steve Holden: "SQL Server stored prcedures with output parameters"
- Next in thread: Steve Holden: "Re: SQL Server stored prcedures with output parameters"
- Reply: Steve Holden: "Re: SQL Server stored prcedures with output parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: 'Steve Holden' <steve@holdenweb.com>, python-list@python.org Date: Thu, 18 Nov 2004 08:54:09 -0000
[Steve Holden]
| However, the stored procedure below appears to consistently
| return zero for the link_id when called with:
|
| columnist_id, url, title, description, link_id = \
| curs.callproc("sp_InsertArticle",
| (columnist_id, url, title, description, 0))
|
| so maybe there really *is* something wrong.
Ummm... Well, I don't know how you'd do it from ado, but
if I were writing this in T-SQL, I'd be saying:
DECLARE @new_link_id
EXECUTE sp_InsertArticle @columnist_id... , @new_link_id OUTPUT
In other words, you have to tell SQL that the param you're
passing in is an output param. Frankly, I don't know why, since
the data dictionary already knows that the formal parameter to
which it corresponds is flagged as output, but there it is.
I don't know (and I don't have the time to look just at the
moment) how ADO handles that.
TJG
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
- Next message: Andrew James: "TPG error when using 't' as the first letter of a token"
- Previous message: Antoon Pardon: "Re: Will python ever have signalhandlers in threads?"
- Maybe in reply to: Steve Holden: "SQL Server stored prcedures with output parameters"
- Next in thread: Steve Holden: "Re: SQL Server stored prcedures with output parameters"
- Reply: Steve Holden: "Re: SQL Server stored prcedures with output parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]