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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Adding UUID to the database table

I want to transform ms sql database table to postgres through a transformation.
In this transformation, I want to add a new column which contains uuid for the new row to be inserted.
As well as uuid should be generated from the table contents itself.
I can transform the table (without uuid) for now..but unable to generate uuid and map it to the postgres database table.
Can I map it through tMap??
Labels (2)
7 Replies
Anonymous
Not applicable
Author

Hi,

Due to there is no "uuid" in your target DB, you should add column of "uuid" first. ("Alter table tablename add Column name type varchar(100)") firstly.
Best regards
Sabrina
Anonymous
Not applicable
Author

You can write a routine to generate your UUID and then just call it from tMap.
e.g.
...
import java.util.UUID;
...
public static String getUUID() {
return UUID.randomUUID().toString();
}
...
Anonymous
Not applicable
Author

I added column for storing "uuid" in target table. And I have my own mechanism (breaking 1 column of same table into pieces and re arranging it) to generate through SELECT sql (using queries in repository).
What does that query returns as result set?? How to see that?
I am giving the output of the query to a tMap component. But the result of that query can not be read by tMap. How to resolve this issue?
tMap is forwardly connected to target DB (Postgres).
Anonymous
Not applicable
Author

Hi,
Result set? Talend provide a component tParseRecordSet which parses a set of records from a database table or DB query and possibly returns single records.
Best regards
Sabrina
Anonymous
Not applicable
Author

@sabrina : I wanted to know, how can I proccess that "uuid" which I have generated in select query. Because I can not see that column name in tMap component while mapping table fields
Anonymous
Not applicable
Author

have you added it to the schema of your database input component? if you have, it should be available to tMap.
Anonymous
Not applicable
Author

@talendByExample : yup. I did that. Still its not working. Do you have any other solution??