Stored Procedure from Datastage not working as expected
Posted: Mon Jun 19, 2017 11:51 pm
Hello,
I have a requirement to generate a unique Sequence number. We currently have a state file doing this but we need to be able to fetch it from a database instead. Our Database is MSSQL Server where there is no availability of a SEQUENCE object. I have therefore written a stored procedure to update a table with a single BIGINT column and return the value.
update dbo.ID
set id=id+1
OUTPUT INSERTED.*
When I execute this in the Management Studio as exec proc1, I get the desired results that is every time it is invoked the id is incremented with 1.
However when I try to call this procedure from Datastage either in a Stored Procedure stage or in an ODBC stage, the value fetched is not a unique value implying that the update was not executed. Any ideas as to what maybe going wrong?
Thank You
I have a requirement to generate a unique Sequence number. We currently have a state file doing this but we need to be able to fetch it from a database instead. Our Database is MSSQL Server where there is no availability of a SEQUENCE object. I have therefore written a stored procedure to update a table with a single BIGINT column and return the value.
update dbo.ID
set id=id+1
OUTPUT INSERTED.*
When I execute this in the Management Studio as exec proc1, I get the desired results that is every time it is invoked the id is incremented with 1.
However when I try to call this procedure from Datastage either in a Stored Procedure stage or in an ODBC stage, the value fetched is not a unique value implying that the update was not executed. Any ideas as to what maybe going wrong?
Thank You