Re: SQL Server stored prcedures with output parameters

From: logistix at cathoderaymission.net (logistix_at_cathoderaymission.net)
Date: 11/19/04


Date: 19 Nov 2004 07:33:44 -0800


> >
> Well, in ADO you'd normally create a command object and then do
> something like
>
> objCmnd.Parameters.Append.CreateParameter("@link_id", &
> adInteger, adParamOutput, , 0)
>
> Unfortunately as far as I can see the DB API docs are silent on how to
> distinguish the output parameters to a callproc(), contenting itself
> with saying """The result of the call is returned as modified copy of
> the input sequence. Input parameters are left untouched, output and
> input/output parameters replaced with possibly new values."""
>

You need to create the parameter seperately so you get a reference to
it. My ADO is a little rusty, but it's something like:

outparam = win32com.client.Dispatch("ADODB.Paramter")
# set param here instead of function
objCmd.Parameters.Append(outparam)

Then you can access outparam after executing the stored proc.



Relevant Pages

  • Re: SQL Server stored prcedures with output parameters
    ... >>Unfortunately as far as I can see the DB API docs are silent on how to ... >>distinguish the output parameters to a callproc, ... >>the input sequence. ... Erm, I was trying to be DB API compatible in Python, so the ADO stuff ...
    (comp.lang.python)
  • Re: Best way to count records returned?
    ... ADO returns OUTPUT parameters only after results are retrieved so you ... need to first process the returned recordset. ... "Steve Lewis - Website Nation" wrote in message ...
    (microsoft.public.sqlserver.programming)
  • RETURN_VALUE????
    ... I am working with ADO in SQL Server 2000 using a ADO ... I see via Refresh that the first parameter is no longer what ... I can collect the output parameters no problem but my question is ...
    (microsoft.public.data.ado)
  • Accessing ADO output parameters from SQL Server to VC++.net
    ... I have a stored procedure in SQL Server database with one input and one ... output parameters. ... ADO, but cannot access the output value. ...
    (microsoft.public.dotnet.framework.adonet)
  • Accessing ADO output parameters from SQL Server to VC++
    ... I have a stored procedure in SQL Server database with one input and one ... output parameters. ... ADO, but cannot access the output value. ...
    (microsoft.public.data.ado)