/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_constraint.sql **/
 EXEC P_ALTERPK 'PK_TCTB_PARAM_APPLY', 'T_TCTB_PARAM_APPLY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCTB_PARAM_APPLY' AND KSQL_INDNAME = 'IDX_TCTB_PARAMAPP_ORG') CREATE INDEX IDX_TCTB_PARAMAPP_ORG ON T_TCTB_PARAM_APPLY ( FORG );


 EXEC P_ALTERPK 'PK_TCTB_PARAM_APPLY_ENTRY', 'T_TCTB_PARAM_APPLY_ENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCTB_PARAM_APPLY_ENTRY' AND KSQL_INDNAME = 'IDX_TCTB_PARAM_APPLY_ENTRY_FK') CREATE INDEX IDX_TCTB_PARAM_APPLY_ENTRY_FK ON T_TCTB_PARAM_APPLY_ENTRY ( FID );


 EXEC P_ALTERPK 'PK_TCTB_PARAM_APPLY_VAL', 'T_TCTB_PARAM_APPLY_VAL', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCTB_PARAM_APPLY_VAL' AND KSQL_INDNAME = 'IDX_TCTB_PARAM_APPLY_VAL_FK') CREATE INDEX IDX_TCTB_PARAM_APPLY_VAL_FK ON T_TCTB_PARAM_APPLY_VAL ( FENTRYID );

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_constraint.sql **/
