Reputation: 1
I am trying to perform ETL Talend Job where I have records in csv file and have to Dump those records in table. My table has Primary key column i.e Id. CSV file does not have Id column. So I have to get max(Id)+1 from table and insert the csv rows one by one with incremental id for each row.
Tried Setting Max(Id) into global variable and increment this id as id+1 in Tmap for each row. But It does not get increment for each record in Csv file
Upvotes: 0
Views: 337
Reputation: 5165
You can create a sequence in your database. Create a view of your sequence and import as a lookup table in Talend. Using TMap, pass the column to your ID. Let me know if you face any issues or further details.
Note: Make sure you make Reload at each row in Lookup Model so that new id gets generated for each row.
Thank you
Upvotes: 0