addPrimaryKey

Adds a primary key out of an existing column or set of columns.

Available attributes

Name Description Required for Supports
catalogName Name of the catalog all
clustered all
columnNames Name of the column(s) to create the primary key on. Comma separated if multiple all all
constraintName Name of primary key constraint all
forIndexCatalogName all
forIndexName db2, db2z, oracle
forIndexSchemaName all
schemaName Name of the schema all
tableName Name of the table to create the primary key on all all
tablespace all
validate This is true if the primary key has 'ENABLE VALIDATE' set, or false if the primary key has 'ENABLE NOVALIDATE' set. all

Database support

Database Notes Auto rollback
DB2/LUW Supported Yes
DB2/z Supported Yes
Derby Supported Yes
Firebird Supported Yes
H2 Supported Yes
HyperSQL Supported Yes
INGRES Supported Yes
Informix Supported Yes
MariaDB Supported Yes
MySQL Supported Yes
Oracle Supported Yes
PostgreSQL Supported Yes
SQL Server Supported Yes
SQLite Not Supported Yes
Sybase Supported Yes
Sybase Anywhere Supported Yes