/**Begin D:\PDM_UPGRADE\PDM1\TCTB_constraint.sql **/
 EXEC P_ALTERPK 'PK_TCTB_JTGZ_RULES', 'T_TCTB_JTGZ_RULES', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCTB_JTGZ_RULES' AND KSQL_INDNAME = 'IDX_T_TCTB_JTGZ_RULES_1') CREATE INDEX IDX_T_TCTB_JTGZ_RULES_1 ON T_TCTB_JTGZ_RULES ( FNUMBER );


 EXEC P_ALTERPK 'PK_TCTB_JTGZ_RULES_ENTRY', 'T_TCTB_JTGZ_RULES_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCTB_JTGZ_RULES_L', 'T_TCTB_JTGZ_RULES_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCTB_JTGZ_RULES_L' AND KSQL_INDNAME = 'IDX_TCTB_JTGZ_RULES_L_0') CREATE INDEX IDX_TCTB_JTGZ_RULES_L_0 ON T_TCTB_JTGZ_RULES_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_TCTB_JTGZ_SHAREPLAN', 'T_TCTB_JTGZ_SHAREPLAN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCTB_JTGZ_SHAREPLAN' AND KSQL_INDNAME = 'IDEX_TCTB_JTGZ_SHAREPLAN_1') CREATE INDEX IDEX_TCTB_JTGZ_SHAREPLAN_1 ON T_TCTB_JTGZ_SHAREPLAN ( FNUMBER );


 EXEC P_ALTERPK 'PK_TCTB_JTGZ_SHAREPLAN_L', 'T_TCTB_JTGZ_SHAREPLAN_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCTB_JTGZ_SHAREPLAN_L' AND KSQL_INDNAME = 'IDX_TCTB_JTGZ_SHAREPLAN_L_0') CREATE INDEX IDX_TCTB_JTGZ_SHAREPLAN_L_0 ON T_TCTB_JTGZ_SHAREPLAN_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_TCTB_JTGZSHARE_ORGS', 'T_TCTB_JTGZSHARE_ORGS', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCTB_JTGZSHARE_RULES', 'T_TCTB_JTGZSHARE_RULES', 'FENTRYID', '1';

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



/**End D:\PDM_UPGRADE\PDM1\TCTB_constraint.sql **/
