> If you see above, the KEYCOL IDENTITY value is reset to 1, I set the
> RESTART value to 999 and followed that alter statement with CACHE set
[quoted text clipped - 3 lines]
>
> Is this by design?
I don't think so, but your sample is Frankenstein's monster.
E.g. your first insert statement won't work and you use different
schemata throughout the repro. So it's hardly compelling evidence of a
problem.
Could you provide a true repro?
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
UDBDBA - 06 Dec 2007 15:37 GMT
Hi Serge,
It's table sample.ID all the way. I wanted to substitute my name
"vijay" with "sample" for schema name in the posting...
What you see in the initial posting is the true repro.
Thanks!
Vijay
> > If you see above, the KEYCOL IDENTITY value is reset to 1, I set the
> > RESTART value to 999 and followed that alter statement with CACHE set
[quoted text clipped - 17 lines]
> DB2 Solutions Development
> IBM Toronto Lab
UDBDBA - 06 Dec 2007 15:55 GMT
Hi Serge,
I have the script tested and here is the output, still the same
problem! I see the problem in V8 FP12 & V9 FP2.
DROP TABLE SAMPLE.ID
DB20000I The SQL command completed successfully.
CREATE TABLE "SAMPLE "."ID" ( "KEYCOL" BIGINT NOT NULL GENERATED BY
DEFAULT AS IDENTITY ( START WITH +1 INCREMENT BY +1 MINVALUE +999
MAXVALUE +9223372036854775807 NO CYCLE CACHE 100000 NO ORDER ) ,
"DWCONTRACTID" BIGINT NOT NULL ) IN "STAGE_1_ALL"
DB20000I The SQL command completed successfully.
delete from sample.id
SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result
of a
query is an empty table. SQLSTATE=02000
insert into sample.id (dwcontractid) values (1001)
DB20000I The SQL command completed successfully.
alter table sample.id alter keycol restart with 100
DB20000I The SQL command completed successfully.
insert into sample.id (dwcontractid) values (1002)
DB20000I The SQL command completed successfully.
select * from sample.id order by 2
KEYCOL DWCONTRACTID
-------------------- --------------------
1 1001
100 1002
2 record(s) selected.
alter table sample.id alter keycol set cache 100000
DB20000I The SQL command completed successfully.
insert into sample.id (dwcontractid) values (1003)
DB20000I The SQL command completed successfully.
select * from sample.id order by 2
KEYCOL DWCONTRACTID
-------------------- --------------------
1 1001
100 1002
100100 1003
3 record(s) selected.
alter table sample.id alter keycol restart with 999
DB20000I The SQL command completed successfully.
alter table sample.id alter keycol set cache 100000
DB20000I The SQL command completed successfully.
insert into sample.id (dwcontractid) values (1004)
DB20000I The SQL command completed successfully.
select * from sample.id order by 2
KEYCOL DWCONTRACTID
-------------------- --------------------
1 1001
100 1002
100100 1003
1 1004
4 record(s) selected.
Thank you.
Vijay
Serge Rielau - 06 Dec 2007 16:36 GMT
Vijay,
OK, I agree that is not working properly. Can you open a PMR?
If support sends you around refer them to me.
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab