I know this "how do i create a unique number for the data that doesn't have a good key candidate?" issue has been beaten to death. In searches I did and talking to other folks I haven't seen much use of @INROWNUM. What is the best practice or what are the pros and cons of using this to create that unique field?
Thanks..
Creating a unique field for data and use of @INROWNUM
Moderators: chulett, rschirm, roy
Re: Creating a unique field for data and use of @INROWNUM
@INROWNUM starts at 1 with every new run. You would already add it to another number to get something unique.
If you're using a database I would suggest that to generate unique keys.
Ogmios
If you're using a database I would suggest that to generate unique keys.
Ogmios
In theory there's no difference between theory and practice. In practice there is.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Then @INROWNUM is a good choice, because it is guaranteed to be unique.
If you have a constraint on the output link, all this means is that you will have gaps in your sequence. If all you're after is uniqueness this is not a problem.
If you don't want gaps in the sequence, prefer @OUTROWNUM.
If you have a constraint on the output link, all this means is that you will have gaps in your sequence. If all you're after is uniqueness this is not a problem.
If you don't want gaps in the sequence, prefer @OUTROWNUM.
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:
I've had a lot of success with @OUTROWNUM, even when appending a table where the last used number is passed in as a job parameter. People are moving to a shared counter design such as a hash file because there is an increasing use of parallel processing, either by multiple instance standard jobs or parallel jobs. Are you sure your job will never become a multiple instance job?
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