I was going thru DB2-730 study material where i found that in a DDL if some column is specified with primary key or unique constraint then DB2 creates an unique index on it automatically.
I was pretty sure that until & unless you define an unique index, uniqueness can not be achieved. Fortunately in my new shop i had authority to create test tables. I created tables in both ways [primary key & unique constraint]....ddl ran fine but coundnt find any index attached with the tables. when I try to insert records on it i'm getting the following error
SQLCODE = -540, ERROR: THE DEFINITION OF TABLE RAJESH.EMP_TEST_CHK
IS INCOMPLETE BECAUSE IT LACKS A PRIMARY INDEX OR A REQUIRED UNIQUE
So, i guess an unique index explicitly requires for DB2 z/os.
Is there any other similar variation for DB2 z/os version.can anyone share a link.
The table is marked as unavailable until its primary index is explicitly created unless the CREATE TABLE statement is processed by the schema processor or the table space that contains the table is implicitly created. In that case, DB2 implicitly creates an index to enforce the uniqueness of the primary key and the table definition is considered complete. (For more information about implicitly created indexes, see Implicitly created indexes.)