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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Single UUID for every job run

The following post describes on how to get a different UUID for each row inserted to Database table. 


When I run a rob, number of rows that gets inserted to DB differs. On every run, I want to insert the same UUID for every row that is inserted on that particular job run. (One UUID for every job run). How to achieve this?

Labels (2)
4 Replies
Anonymous
Not applicable
Author

Talend itself provides such a UUID called talendPid. This is a member variable in every job. The problem here is, it is not entirely unique over a long time. I suggest you add a timestamp on it and this makes it absolut unique. 
Anonymous
Not applicable
Author

WAIT ! talendPid is not even close to an UUID ( see UUID Specifications)

you can use java.util.UUID https://docs.oracle.com/javase/7/docs/api/java/util/UUID.html
in the beginning of your Job  put it into th globalMap and use it as needed

cheers
Anonymous
Not applicable
Author

Yep, this is also a good way. There are plenty of classes providing a secure unique UUID.
Me and my colleagues have designed a concept and dedicated components to create such UUID based on a database sequence and also with a lot of stuff to steer the jobs and measure the metrics.
https://exchange.talend.com/#marketplaceproductoverview:gallery=marketplace%252F1&pi=marketplace%252...
Take a look at the documentation before check it out.
Anonymous
Not applicable
Author

Before you insert, place a UUID on the globalMap and then insert it.
You can create this in tJava and then map it in tMap, for example: -
tJava(onSubjobOK)->tFileInputDelimited(row1)->tMap(row2)->tMySQLOutput
In tJava, add something like: -
globalMap.put("UUID", java.util.UUID.randomUUID().toString());