Home » SQL & PL/SQL » SQL & PL/SQL » Composite Primary Key & dup_val_on_index (2 merged)
icon4.gif  Composite Primary Key & dup_val_on_index (2 merged) [message #244738] Thu, 14 June 2007 00:37 Go to next message
thisisnatesh
Messages: 92
Registered: March 2007
Member
Having composite primary key on c1, c2 columns and with 2 records 1,2 and 1,3 in the columns, will dup_val_on_index exception raises or not for the first column values?
icon4.gif  Index values for composite primary key [message #244748 is a reply to message #244738] Thu, 14 June 2007 00:58 Go to previous messageGo to next message
thisisnatesh
Messages: 92
Registered: March 2007
Member
created a table with 3 columns c1,c2,c3 with composite primary key. for the whole PK a single unique index was created. now if i insert a record with values 1,1,2 how the values are stored in a unique index? Rolling Eyes
Re: Index values for composite primary key [message #244766 is a reply to message #244748] Thu, 14 June 2007 01:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
something like: 1||1||2

Regards
Michel
Re: Composite Primary Key & dup_val_on_index (2 merged) [message #244767 is a reply to message #244738] Thu, 14 June 2007 01:25 Go to previous message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Is the key is composite, the unicity is on all the columns not only one.

Just try it.

Regards
Michel
Previous Topic: optimizer hints
Next Topic: Pound (£) sign in Oracle 8i
Goto Forum:
  


Current Time: Tue Feb 18 20:51:11 CST 2025