Page 1 of 1

Issue with order of primary keys

Posted: Mon Mar 01, 2010 9:00 am
by bharatagnihotri
DS - 7.5.1 (DB2 API and EE stages)

Is there any know issue with the sequence of primary keys for a DB2 table (DB2 API or EE stages) ?

i.e. say we have a table T1 with following structure:

Collumn Primary Key
C1 Y
C2 N
C3 N

A datastage job is created for this table structure. After this now the table structure is changed and a new collumn and key is added.

Collumn Primary Key
C1 Y
C2 N
C3 N
C4 Y

Here, is there any known issue with the primary key defined at the end of the table, instead of the start with other primary keys ?

Cheers,
BA

Posted: Mon Mar 01, 2010 9:15 am
by chulett
No, there's no rule as to where or in what order they need to be declared in the table. That's a people thing.

Thanks

Posted: Mon Mar 01, 2010 9:22 am
by bharatagnihotri
[quote="chulett"]No, there's no rule as to where or in what order they need to be declared in the table. That's a people thing. ...[/quote]

Thanks for your reply, just one more thing, will it impact the job (if we don't add this key) in any way i.e. will it require job change or anything of that sort ? I think the issue is seen with the hash file i.e. the keys have to be in same order and all of them shud be there, but was not sure if this holds for the EE stage as well..

Posted: Mon Mar 01, 2010 10:04 am
by kduke
It does make a difference in a hashed file. Otheriwse Craig is correct. In a SQL statement it makes no difference.

Posted: Mon Mar 01, 2010 10:37 am
by chulett
Right, in a RDBMS table it makes absolutely no difference where indexed fields are in the table, including the PK fields. As noted, the only thing that seems to care is the wetware, the people.