Can someone please suggest a way to generate unique sequence numbers within Ascential. The purpose is to assign that number to a column in a table each time a new record is created using datastage.
Currently I am using Oracle sequences (and having a trigger on insert on the table to populate the column) , but was wondering if there is some other way to do it.
Thanks in advance.
Fred.
Generating sequence numbers
Moderators: chulett, rschirm, roy
Re: Generating sequence numbers
Forget Triggers. Use [columnname].NEXTVAL. For example:fred wrote:Can someone please suggest a way to generate unique sequence numbers within Ascential. The purpose is to assign that number to a column in a table each time a new record is created using datastage.
Currently I am using Oracle sequences (and having a trigger on insert on the table to populate the column) , but was wondering if there is some other way to do it.
Thanks in advance.
Fred.
INSERT INTO [Table] ([field]) VALUES ([field].NEXTVAL)
Of course, you will need to ensure that the column is a sequence column. (We use SQL Navigator, and it's part of the Sequences subcategory).
This is true for DataStage 6.0r3 Server Job using Ora9i stage, the results may varies for Parallel Job (I never tried it that way, I just use a custom stage.)
-T.J.