Primary index vs primary key

Posted by Admin on 02-May-2007 15:45

I would like to know the difference between a primary index in the 4GL language and a Primary Key constraint in SQL for Progress. Are they the same thing?

All Replies

Posted by Thomas Mercer-Hursh on 02-May-2007 16:16

No, they are not the same thing. The Progress DB doesn't have constraints defined by SQL in the same why that something like Oracle does. For Oracle, a primary key contraint means that the indicated field(s) is a) the primary key; b) is unique; and c) cannot be null.

You can accomplish this same effect in Progress by defining an index for a field which is tagged as mandatory, i.e., not null, and then defining the index as primary and unique.

But, a primary key in Progress doesn't need to be unique, nor does it need to be not null. That is left to your design.

Posted by Tim Kuehn on 02-May-2007 16:17

Key constraints and foreign key constraints are coming - the "rumor" is they'll be announced at Exchange 2007.

Posted by Admin on 03-May-2007 01:17

The 4GL requires a primary index for every table. This primary index doesn't have to be unique. The Progress Sql Primary Key constraint is something you tag per column and is optional. A Sql Primary Key constraint is a "constraint on uniqueness", but isn't equal to an index.

This thread is closed