Page 1 of 1

Sequence Id

Posted: Mon Feb 25, 2008 2:24 am
by praburaj
Hi,

My source table having 14,00,000 records. When i have tried to insert the records in to database, out of 14,00,000 records only 10,00,000 records only inserted. Even i have checked in source table any records are duplicate. There no records are duplicate. I hope there is some problem in creating Sequenc_Id. I want to create sequence id for all rows. For that one i have written some query which i have mentioned below.

"if STGLDSEQI = -1 then DSLink30.SEQ_I + @PARTITIONNUM +1
else STGLDSEQI + @NUMPARTITIONS".

while i run the job, i got errors are like this

" Error Idx = 12;
DB2 Driver Embedded SQL message: SQL0803N One or more values in the INSERT statement, UPDATE statement, or
foreign key update caused by a DELETE statement are not valid because the
primary key, unique constraint or unique index identified by "1" constrains
table "ADW.MDSE_STYLE_CHAR_E" from having duplicate values for the index key.
SQLSTATE=23505
;
sqlcode = -803;
sqlstate = 23505
Execute failed
the runLocally() of operator [DB2_UDB_Enterprise_76], partition 0 of 1"

Note: Target table LD_SEQ_Id. This column is a key column.


Can anybody help me to resolve this issue?... :roll:

Posted: Mon Feb 25, 2008 2:35 am
by ArndW
What are you using the "if" statement for? Is it the derivation of the unique primary key?

The error message is quite clear that you are loading duplicate keys. If you put in a reject link you will see which keys are incorrect and can proceed accordingly.

Posted: Mon Feb 25, 2008 3:10 am
by praburaj
Yes! that is the derivation for unique primary key. How can i take reject link from transformer?..... Can you explain briefly how to resolve this?...

Posted: Mon Feb 25, 2008 3:11 am
by ArndW
In PX you cannot take a reject from a transform stage, you need to do it from the Database passive stage. Draw a reject link and activate rejects in the stage details and then either use PEEK or write the errors to a target.

Posted: Mon Feb 25, 2008 4:08 am
by ray.wurlod
Your expression is unnecessarily complex. You seem to be using a job parameter as the initial value (this is good).

Generate a sequence beginning from 0 (initial value=partition number, increment=number of partitions) and add that to the initial value.