Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] generating a new GUID for each insert

Hi I am new to Talend open studion ETL and has a question that I hope some of you experts will be able to assist me with.
I have an ETL job the selects data from an informix database processes then loads it into an MSSQL, when it inserts into the MSSQL i need to generate a new GUID with a command similar to 'select newid() as GUID' from the destination MSSQL DB for each new record I insert. I could do this by setting the db to generate but it's a third party db which has a web front end that I cannot make changes to so I need to do it as part of the load, I also need to use the new GUID in a second table (this is used to join the tables).
Can anyone suggest a way to run 'select newid() as GUID' each time I process a record to insert ?
Any help you can give will be greatly appriciated
Tony
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

In the end I used select newid() as GUID on the sql database then used tMap (Attached) to load a unique GUID for each record

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi Tony
Hope this topic can help you,
https://community.talend.com/t5/Design-and-Development/resolved-How-to-use-UUID-keys-with-MySQL-in-T...
Create a routine and hard code to generate a GUID, insert it into DB on each row.
Best regards
Shong
janhess
Creator II

The problem with generating a GUID outside the database is that it may not be unique as it doesn't follow the rules that the database is using for the table.
I've alwasy had to let the database create it and then retrieve it to use for the table join. A real pain but that's the problem with GUIDS. Globally unique and totally useless.
Anonymous
Not applicable
Author

In the end I used select newid() as GUID on the sql database then used tMap (Attached) to load a unique GUID for each record