Capture Stored procedure Retrun value

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Capture Stored procedure Retrun value

Post by myukassign »

I have a requirement to call a stored procedure from ODBC stage and capture the return value.

The issue is , I don't know what should be the name of the return value, I tried all possible things but it gives me the binding error.

"##W TFOR 000000 05:00:06(014) <ODBC_Enterprise_20> When checking operator: The modify operator has a binding for the non-existent output field "return_value".
##W TFOR 000000 05:00:06(015) <ODBC_Enterprise_20> When checking operator: The modify operator keeps field "return_value" which is not present in the output int"


Steps I am doing

1. My stored procedure looks like this.

create procedure GetNewSeqVal_SEQUENCE
as
begin
declare @NewSeqValue int
set NOCOUNT ON
insert into SEQUNCE (SeqVal) values ('anyval')

set @NewSeqValue = scope_identity()

return @NewSeqValue
end

2. Created the following canvas, ODBC stage -> File stage . In odbc stage user defined SQL I gave "execute GetNewSeqVal_SEQUENCE"

3. The column defnion of the odbc stage I tried with just one column "RETURN_VALUE" . But it gives me the binding error. I know very well that, the return value column name of my stored procedure and the column name I decalred is not matching. I also tried the names like "NewSeqValue"

Kindly request anyone to help me here, what should I given as the column name or my mistake is something else.

* I test the stored proc separatly and its working and its a SQL server Store proc.
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Re: Capture Stored procedure Retrun value

Post by myukassign »

Is it possible to call a stored procedure from odbc stage and capture its return value in datastage?

Please help
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Call? Yes. Capture? No. As far as I know, you'd need to use the actual Stored Procedure stage for that functionality.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply