Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Generating Unique sequence number when same job running in two different systems

Hi,

 

I got stuck how to get the unique sequence number when the same job runs in two different machines at the same time in the same table. The sequence number should be unique and update the rows in the same table without any rows missed.

 

looking for any suggestions.

Thanks in Advance

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

You need to set up a sequence in your database. Take a look here for that: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-sequence-transact-sql?view=sql-server-2...

 

Then you need to use that sequence in Talend. To do that you can use a tMSSqlInput with code similar to below (assuming your sequence is called MySequence).

 

"SELECT NEXT VALUE FOR MySequence as seqnum" 

 

View solution in original post

3 Replies
Anonymous
Not applicable
Author

The only way to do this is to use a database sequence (if you can) or to hold the sequence in another location that both (all) jobs have access to. I generally use a database sequence to handle anything that requires a sequence that isn't reset after the job has finished running.

Anonymous
Not applicable
Author

Thank you for the quick reply

Can u please elaborate how would we implement in TDI for MSsql.

please help.

 

thanks,

raghav

Anonymous
Not applicable
Author

You need to set up a sequence in your database. Take a look here for that: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-sequence-transact-sql?view=sql-server-2...

 

Then you need to use that sequence in Talend. To do that you can use a tMSSqlInput with code similar to below (assuming your sequence is called MySequence).

 

"SELECT NEXT VALUE FOR MySequence as seqnum"