
Anonymous
Not applicable
2011-06-12
07:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[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
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
824 Views
1 Solution
Accepted Solutions

Anonymous
Not applicable
2011-07-06
10:26 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
824 Views
3 Replies

Anonymous
Not applicable
2011-06-12
10:40 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
824 Views

Creator II
2011-06-13
05:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
824 Views

Anonymous
Not applicable
2011-07-06
10:26 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
825 Views
