WARNING: as primary key violated

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

WARNING: as primary key violated

Post by pxraja »

Hi all,

I am using ODBC_src-->TRF-->ODBC_trg, ODBC_trg has composite primary keys while I am running this job my job runs successfully, but i am getting 2000+ warnings... like

JobName..Trf.Lnk_: DSD.BCIPut call to SQLExecute failed.
SQL statement: INSERT INTO TABLE NAME(FIELDNAME) VALUES (?,?,?,?,?,?,?,?,?,?)
SQLSTATE=23000, DBMS.CODE=1
[DataStage][SQL Client][ODBC][DataDirect][ODBC Oracle Wire Protocol driver][Oracle]ORA-00001: unique constraint (RELODS.CDA_MASTER_PK) violated

but when I added a sequential without mentioning any key columns and constraint as REJECTED.

the job runs without any warnings! no rows were rejected to sequential file

Though the job run's successfully! I want to understand this behaviour

Any clarifications are welcomed

Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If a table has no primary key you can insert the same row as many times as you wish. There is nothing to enforce uniqueness.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

Also I am having only one constraint (i.e., REJECTED)
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

Hi ray,

I think I misled you

actually, I need the clarifications like, why the warnings are not coming when I am using another sequential file while having the constraint(rejected)? whereas no rows were rejected to sequential file.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you're writing to a sequential file there's no notion of a key - you just write a line at a time. The only time REJECTED would be triggered is if you couldn't write to the file at all, for example disk full, quota exceeded, file size limit reached, no write permission.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pxraja
Participant
Posts: 142
Joined: Fri Mar 14, 2008 10:22 am

Post by pxraja »

thanks ray

for your guidance
Post Reply