how to create unique sequence no with reference to primary
Moderators: chulett, rschirm, roy
how to create unique sequence no with reference to primary
Hi all,
requirement is like this,
Unique numbers should be generated based upon the composite primary keys. for example,
Inlink.Field1 Inlink.Field2 Inlink.Field3 Inlink.Field3
65465 'kjdjfsak' 5645 'kjdfoi'
68845 'doewlks' 8556 'dkgjioe'
65465 'eujdskd' 6455 'doewl'
Outlink.Field1 Outlink.Field2 Outlink.Field3 Outlink.Field4 Outlink.Field5
1 65465 'kjdjfsak' 5645 'kjdfoi'
2 78845 'doewlks' 8556 'dkgjioe'
3 65465 'eujdskd' 6455 'doewl'
where Inlink.Field1 and Inlink.Field3 are primary keys
and Outlink.Field1 is the Unique Field
any ideas are welcome
Thanks in Advance
requirement is like this,
Unique numbers should be generated based upon the composite primary keys. for example,
Inlink.Field1 Inlink.Field2 Inlink.Field3 Inlink.Field3
65465 'kjdjfsak' 5645 'kjdfoi'
68845 'doewlks' 8556 'dkgjioe'
65465 'eujdskd' 6455 'doewl'
Outlink.Field1 Outlink.Field2 Outlink.Field3 Outlink.Field4 Outlink.Field5
1 65465 'kjdjfsak' 5645 'kjdfoi'
2 78845 'doewlks' 8556 'dkgjioe'
3 65465 'eujdskd' 6455 'doewl'
where Inlink.Field1 and Inlink.Field3 are primary keys
and Outlink.Field1 is the Unique Field
any ideas are welcome
Thanks in Advance
-
- Premium Member
- Posts: 232
- Joined: Fri Aug 04, 2006 1:20 am
- Location: Bangalore
Use the routine KeyMgtGetNextValueConcurrent for getting Sequence number.
Do whatever mechanism in your job to identify the unique string, use order by in your sql , and use stage variables to identify the uniqueness, or use a lookup to idetify the uniqueness.
and for the unique value, just call the routine as KeyMgtGetNextValueConcurrent('whateverstring') , this will give you the unique sequence number.
Do whatever mechanism in your job to identify the unique string, use order by in your sql , and use stage variables to identify the uniqueness, or use a lookup to idetify the uniqueness.
and for the unique value, just call the routine as KeyMgtGetNextValueConcurrent('whateverstring') , this will give you the unique sequence number.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
sequence should start with 1 and its should be incremented by 1 when using the KeyMgtGetNextValueConcurrent('Whateverstring'), will it provides incremental value from the last sequence? how to get the value of the last sequence and on the next run the sequence should start with last sequence value +1DS_SUPPORT wrote:Use the routine KeyMgtGetNextValueConcurrent for getting Sequence number.
Do whatever mechanism in your job to identify the unique string, use order by in your sql , and use stage variables to identify the uniqueness, or use a lookup to idetify the uniqueness.
and for the unique value, just call the routine as KeyMgtGetNextValueConcurrent('whateverstring') , this will give you the unique sequence number.
Any suggestions are welcome
Thanks in Advance
-
- Premium Member
- Posts: 232
- Joined: Fri Aug 04, 2006 1:20 am
- Location: Bangalore
While running a new job with KeyMgtNextValueConcurrent(1), the sequenct number is starting with lastMax Sequence used in some other job. How to make the new job to start with the sequence starts with 1 and how to maintain the sequence for that particular Job.DS_SUPPORT wrote:Yes, Your sequence number will start with 1, and for the next run also, it will give you the next max number. You dont have to do any extra settings for achieving this.
But when using, consider changing 'whateverstring' to some meaningful string.
I want to use KeyMgtNextValueConcurrent(1) for Job wise, but it is taking the value from project wise.
Any suggestions are welcome
Thanks in Advance
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 232
- Joined: Fri Aug 04, 2006 1:20 am
- Location: Bangalore