Primary Index allows null values?

Dharmendra

New Member
Hi,

Can anyone confirm the below question regarding primary index.

CREATE abc.
ASSIGN abc.a = ""
abc.b = ""
abc.c = 1
abc.d = "1".

Here field b in the table abc is primary index and allowed null values multiple times.

So my question is does primary index allows null values as like unique index does(only one null value).

If this is allowed then the differences between unique and primary index are
1) the unique index allows unique record and primary allows multiple.
2) Only one primary is allowed and multiple unique indexes are allowed for a table.

And also primary unique index acts like unique index but at the same time it also acts like primary index for a table.

Please confirm.
 

Cringer

ProgressTalk.com Moderator
Staff member
Primary and Unique are 2 different concepts. The Primary index does not have to be unique. If your index is not specifically set to unique it will allow multiple records with the same value.
 

TomBascom

Curmudgeon
"Primary" does not mean much of anything. It is simply the default or "tie-breaker" index choice if no other index is specified or chosen when index selection rules are being evaluated.
 
As per my understanding, as the name suggest, it is "Primary" index to extract records from DB tables via Index entries (Pointers). Every table must have Primary index and if its not defined then default primary index must be created. Unique and Primary are two complete different things.

Regards
 

Casper

ProgressTalk.com Moderator
Staff member
and to add to this all: null is not the same as empty for a string. abc.a = '' is empty not null. abc.a =? is null.
The latter is not allowed if mandatory is checked for the database field.
 

tamhas

ProgressTalk.com Sponsor
And, to emphasize, if mandatory is not checked, then there can be multiple records all with the same ? value even if the index is marked as unique.
 
Top