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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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. 0683p000009MACJ.png

 

 

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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

 

View solution in original post

2 Replies
Anonymous
Not applicable
Author

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

 

Anonymous
Not applicable
Author

Thank you, it work 0683p000009MACJ.png