Earlier I had inserted some data where the id column was provided explicitly. When later I attempted to insert data using the autoincrement feature, a conflict occurred when the "next value" was already taken by the initial data.
Obviously that's a risk one takes when using the BY DEFAULT clause.
User Profile
Collapse
-
I figured this out, please disregard it and sorry for your time.Leave a comment:
-
Please help with INSERT
Using DB2 LUW v9.7, I have a table where the primary key is an identity column, generated by DEFAULT NO CYCLE . COL1 is the key, COL2, COL3 and COL4 are the remaining columns. An index is created on COL1. No other index exists.
But I can't insert data into it.
I write the insert like this, skipping the first column so DB2 will pick the value:
insert into mytable (col2, col3, col4) values (1,6,'some_text ')"...
No activity results to display
Show More
Leave a comment: