Output from Extended Stored Procedure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig Hoskin

    Output from Extended Stored Procedure

    Hi all

    Ive got a problem I was hoping someone may be able to help with.

    Im calling an extended stored procedure provided by a third party
    (master..xp_Ord erHeader).
    This xp requires 3 inputs and is supposed to provie one output.

    When I call it in SQL Query Analyser all runs OK and I get a column result
    (single result) titled "Output_Inf o" with a value of say 300051

    Here is an example call
    execute master..xp_Orde rHeader @CustID, @TodayDate, @OrderID,
    @Output_Info OUTPUT

    I would have thought that my variable @Output_Info would hold the output,
    but all I get is NULL?

    Any ideas what Im doing wrong. Seems bizarre that the XP Ive been provided
    is displaying a result (be it a coumn I haven't named) ... but I can get it
    into my variable for use.

    Cheers

    Craig


  • Simon Hayes

    #2
    Re: Output from Extended Stored Procedure

    "Craig Hoskin" <nospam@infobah n.co.nz> wrote in message news:<OdoUb.348 28$9k7.740374@n ews.xtra.co.nz> ...[color=blue]
    > Hi all
    >
    > Ive got a problem I was hoping someone may be able to help with.
    >
    > Im calling an extended stored procedure provided by a third party
    > (master..xp_Ord erHeader).
    > This xp requires 3 inputs and is supposed to provie one output.
    >
    > When I call it in SQL Query Analyser all runs OK and I get a column result
    > (single result) titled "Output_Inf o" with a value of say 300051
    >
    > Here is an example call
    > execute master..xp_Orde rHeader @CustID, @TodayDate, @OrderID,
    > @Output_Info OUTPUT
    >
    > I would have thought that my variable @Output_Info would hold the output,
    > but all I get is NULL?
    >
    > Any ideas what Im doing wrong. Seems bizarre that the XP Ive been provided
    > is displaying a result (be it a coumn I haven't named) ... but I can get it
    > into my variable for use.
    >
    > Cheers
    >
    > Craig[/color]

    I don't know much about extended SPs, but I guess that it has simply
    not been written to support an output parameter. The easiest solution
    is probably to use a temp table:

    create table #t (Output_Info int)
    insert into #t exec master..xp_Orde rHeader (...)
    select @Output_Info = Output_Info from #t

    Simon

    Comment

    Working...