how to add sequence number for Existing primary key field for uniqueness
for Example :
181DAC246 + start with the sequence 0001 to every record
181DAC246 +0001
181DAC247 +0002
thank you
How to add sequence number
Moderators: chulett, rschirm, roy
How to add sequence number
Last edited by srao on Wed Apr 18, 2007 7:49 pm, edited 1 time in total.
You mean concatenate, not add - yes? If so, generate the number and use the colon (:) concatenation operator to stick them together. Perhaps you need a surrogate key generated, perhaps it just needs to be the @INROWNUM. You'd have to tell us.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Is the base number hexadecimal and you wish to add, or is it the leading digits to which you want to append a four digit sequence number? Should the sequence number be hexadecimal or decimal?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Have a look at the FAQ forum on generating a unique counter in a parallel job. The surrogate key stage wont let you do a complex increment, a parallel transformer will. You need to use the parallel macros for partition numbers to make sure numbers are unique between parallel instances of the transformer.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Code: Select all
PrimaryKey : FMT(@INROWNUM,"4'0'R")
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: