• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SDO and auto increment keys in DB2

 
Rudy Koento
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using Relational Record component from Rational Application Developer, which uses SDO. I have a problem with regards to adding a new record.

In DB2, I've set my table to have an auto increment column. But for some reason, SDO is trying to set the value for that column, which gives me the following error SQLCODE -798.

Checking on the web, the error code means YOU CANNOT INSERT A VALUE INTO A COLUMN THAT IS DEFINED WITH THE OPTION GENERATED ALWAYS. COLUMN NAME.

How can I disable SDO so that it does not provide the value for the auto-generated column?
 
Charles McGuire
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can set the value to NULL, or drop the column from the SQL insert statement altogether, DB2 will take it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic