Hi,
I'm using DB2 V9 for windows
I'm inserting records into DGTT from select statement; the problem is
how to insert unique value for every row inserted.
I tried using “generated always as” clause but its exhausting at some
point of time.
Say if 100000 records were needed to be processed, it’s only
processing up to 60000 rows.
Would you please tell me what I’m missing, and is there any workaround
to generate unique value for DGTT?
here is the syntax how i have created.
DECLARE GLOBAL TEMPORARY TABLE SESSION.TABLE_3(
id INTEGER NOT NULL GENERATED ALWAYS AS
IDENTITY (START WITH 1, INCREMENT BY 1),
cd1 CHAR(5) NOT NULL,
id2 DECIMAL(16, 0) NOT NULL
)
IN USER8KSPACE
WITH REPLACE
PARTITIONING KEY (cd1,id2)
NOT LOGGED
ON COMMIT PRESERVE ROWS
;