Skip to main content


Set primary key constraint behavior.


[SQL]    IdKey=n

n is either 1 or 0. The default value is 1.


When IdKey is enabled (n = 1), when a Primary Key constraint is specified through DDL it does not also become the IDKey index in the class definition.

When this parameter is not enabled, a Primary Key constraint specified through DDL also becomes the IDKey index in the class definition. This ption generally gives better performance, but means that the Primary Key fields cannot be updated.

For further details, refer to the SET OPTION, CREATE TABLE, and ALTER TABLE commands.

Changing This Parameter

On the SQL page of the Management Portal (System Administration > Configuration > SQL and Object Settings > SQL), select Define primary key as ID key for tables created via DDL to disable IdKey.

To set the desired value for IdKey from the Terminal, use the SetOption(“DDLPKeyNotIDKey”)Opens in a new tab method of the %SYSTEM.SQL.UtilOpens in a new tab class. See the class reference for details.

You can also change IdKey with the Config.SQLOpens in a new tab class (as described in the class reference) or by editing the CPF in a text editor (as described in Editing the Active CPF).

FeedbackOpens in a new tab