‎2006 Nov 10 10:42 AM
Hi Experts,
What is the difference between a Primary key and Unique in ABAP?
Regards
‎2006 Nov 10 10:45 AM
Hi
The primary key is the key obtained by all key fields, an unique key is a key created by several fields (they can be or not be key fields) and the key has to be unique.
So the primary key is always unique key a secondary index could be unique, but generally it isn't.
Max
‎2006 Nov 10 10:45 AM
Hi
The primary key is the key obtained by all key fields, an unique key is a key created by several fields (they can be or not be key fields) and the key has to be unique.
So the primary key is always unique key a secondary index could be unique, but generally it isn't.
Max
‎2006 Nov 10 10:46 AM
Hi
1. This concept of primary key and unique key
comes into picture at the database level
(especially oracle)
2. The only difference is that
unique key allows
insertion of a NULL value
into the key field(s)
Where as primary key does not allow.
3. Similary is ;
Both maintain unique/distinct values
in the table.
I hope it helps.
regards,
Anver
‎2006 Nov 10 10:58 AM
‎2006 Nov 10 10:47 AM
Hi Ravi,
Primary Key = Not Null + Unique(You cannot store empty or null values into Primary key)
Unique Key = You can store one empty value along with other unique values.
Simply, if your field is Primary key , you cannot insert a duplicate or a empty value into it.
But if it is unique then you can inser one empty value but it should not be duplicate.
Regards,
Raghav