Create a Table Constraint
Use this API to create a constraint for a Table definition or a Table instance.
Name
CDR_PUB_DF_TABLE.CreateTableConstraint
Signature
PROCEDURE CREATETABLECONSTRAINT( P_API_VERSION IN NUMBER, P_INIT_MSG_LIST IN VARCHAR2 := CDR_PUB_DEF_CONSTANTS.G_FALSE, P_COMMIT IN VARCHAR2 := CDR_PUB_DEF_CONSTANTS.G_FALSE, P_VALIDATION_LEVEL IN NUMBER := CDR_PUB_DEF_CONSTANTS.G_VALID_LEVEL_FULL, X_RETURN_STATUS OUT VARCHAR2, X_MSG_COUNT OUT NUMBER, X_MSG_DATA OUT VARCHAR2, PIO_NAMING IN OUT CDR_NAMING_VERSION_OBJ_TYPE, PIO_CONSTRAINT IN OUT CDR_TABLE_CONS_OBJ_TYPE, PI_CONSTRAINTCOLUMNS IN OUT CDR_TABLE_CONCOLS_LIST_COLL, PI_VALS IN CDR_VALS_COLL );
Parameters
This API has standard parameters (see Standard Parameters) and the following parameters:
- PIO_NAMING (Mandatory) This is a parameter of table type CDR_NAMING_VERSIONS_OBJ_TYPE that contains CDR Naming Version attributes. Enter $OBJTYPES$TABLECNSTR for OBJECT_TYPE_RC.
- PIO_CONSTRAINT (Mandatory) This is a parameter of table type
CDR_TABLE_CONS_OBJ_TYPE. You must enter values for CONSTRAINT_TYPE_RC.
The possible values are: $CONSTRAINTYPES$CHECK, $CONSTRAINTYPES$NUINDEX, $CONSTRAINTYPES$PRIMARYKEY, and $CONSTRAINTYPES$UNIQUE.
- PI_CONSTRAINTCOLUMNS (Mandatory) This is a collection of table type
CDR_TABLE_CONCOLS_OBJ_TYPE. Identify the Table and the Table's columns where you want to
apply the Constraints. Depending on the Constraint, you must also provide values for
attributes that define Foreign Key, or that identify the List of Values object to store
the values for a CHECK Constraint.
The following attributes are required: TABC_COMPANY_ID,TABC_OBJ_ID,TABC_OBJ_VER,FK_COL_COMPANY_ID,FK_COL_OBJ_ID,FK_COL_OBJ_VER,POSITION,COL_COMPANY_ID,COL_OBJ_ID,COL_OBJ_VER,LOV_COMPANY_ID,LOV_ID,LOV_VER
- PI_VALS (Optional) This is a collection of CDR_VAL_OBJ_TYPE that contains the values for a CHECK Constraint.
Parent topic: Create and Modify Tables