Six Stars

How to insert to table has an auto increment field with tDBOutput?

Hi all,

I have thousand CSV data rows and I want to insert them into a table has an auto increment field, I use:

tFileDelimited -> tMap ->  tDBOutput   But it insert data with wrong columns order

 

I print SQL query to console by tJava with ((String)globalMap.get("tPostgresqlOutput_5_QUERY")), then copy the query to Database IDE and excute, it work - insert successful.

 

What happend with my job ? And How to insert to table has an auto increment field with tDBOutput?

Thank all. Smiley Very Happy

 

 

  • Data Integration
2 ACCEPTED SOLUTIONS

Accepted Solutions
Six Stars sgv
Six Stars

Re: How to insert to table has an auto increment field with tDBOutput?

Hi,

 

For auto-increment, you can use a sequence with  Numeric.sequence("s1",1,1), you can find it on tmap java editor in category Numeric. But this sequence is only good for an unique use... if your job is re-run , the sequence back to 1 (but you can initialize with the max Numeric.sequence("s1", globalMap.get("MaxRow") ,1) )  or someting like that...

 

I don't know if this help you .

Good luck

SGV

 

Six Stars

Re: How to insert to table has an auto increment field with tDBOutput?

Thank you, it work Smiley Very Happy
2 REPLIES
Six Stars sgv
Six Stars

Re: How to insert to table has an auto increment field with tDBOutput?

Hi,

 

For auto-increment, you can use a sequence with  Numeric.sequence("s1",1,1), you can find it on tmap java editor in category Numeric. But this sequence is only good for an unique use... if your job is re-run , the sequence back to 1 (but you can initialize with the max Numeric.sequence("s1", globalMap.get("MaxRow") ,1) )  or someting like that...

 

I don't know if this help you .

Good luck

SGV

 

Six Stars

Re: How to insert to table has an auto increment field with tDBOutput?

Thank you, it work Smiley Very Happy