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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Updating a DB2 Table which has AUTO INCREMENT

Hello,

 

I have a DB2 table, which has been created with the option:

 

"E_SID" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH 1 INCREMENT BY 1),

PRIMARY KEY (E_SID)

 

Now I want to update some field by using tMap. Since it's an update I need to define the key field in the target table. The problem is when I do that, I get an error from the DB2 database saying, that the target field can not be written manually, since it has been declared with auto increment. If I would remove the this field, the update cannot be made, because of the missing key field. Do I have to remove the auto increment from the table to be able to do an update?

 

0683p000009MPeQ.jpg

Labels (2)
4 Replies
vapukov
Master II
Master II

Hi,

 

did you try in advanced settings of output component, select use field option and uncheck updatable, like this:

0683p000009M2Da.png

Anonymous
Not applicable
Author

Thanks for the advice @vapukov 

 

I was not aware of this option. But in this case I had another problem in another output component. I was just looking at the wrong place. If the update is set up as in my example, it now works as designed.

 

Thanks!

vapukov
Master II
Master II

ok,

 

this settings independent for each component (and for insert/update), so must be no collisions, but if it work is good 0683p000009MACn.png

Anonymous
Not applicable
Author

Yes, you are absolutely right! Thanks for sharing 😃