Home » SQL & PL/SQL » SQL & PL/SQL » Primary Key Creation
Primary Key Creation [message #212369] Thu, 04 January 2007 23:54 Go to next message
Messages: 3
Registered: January 2007
Location: Chennai
Junior Member
Hi All,

I have one query for creating Primary Key & Unique Key.

1) Is there possible to create the primary after loading data.

For example, In EMP table i have inserted 10 rows with duplicates(EMP_ID). After inserting the datas i want to create the primary for EMP_ID. Now EMP_ID duplicate values are enforcing or not?

2) I create one unique constraint for one column. Unique accepts null value. But its not accept duplicate values.

My question is Shall give more than one null value into unique constraint column.


Re: Primary Key Creation [message #212392 is a reply to message #212369] Fri, 05 January 2007 02:15 Go to previous message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
1) If there are duplicate values in your Emp_Id column then you will be unable to create a primary key constraint, as it will check for uniqueness when you create it.

2) You can have multiple null values in a column with a unique constraint.
Previous Topic: Retrieving data
Next Topic: Min date value in the future, how can I do it??
Goto Forum:

Current Time: Wed Aug 23 14:39:41 CDT 2017

Total time taken to generate the page: 0.01480 seconds