/**Begin D:\PDM_UPGRADE\PDM1\FCS_constraint.sql **/
 EXEC P_ALTERPK 'PK_FCS_RISKBUSIINFO', 'T_FCS_RISKBUSIINFO', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKBUSIINFO_1') CREATE UNIQUE INDEX IDX_FCS_RISKBUSIINFO_1 ON T_FCS_RISKBUSIINFO ( FNUMBER );


 EXEC P_ALTERPK 'PK_FCS_RISKBUSIINFO_L', 'T_FCS_RISKBUSIINFO_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKBUSIINFO_L_0') CREATE INDEX IDX_FCS_RISKBUSIINFO_L_0 ON T_FCS_RISKBUSIINFO_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_FCS_RISKCONFIG', 'T_FCS_RISKCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKCONFIG_1') CREATE UNIQUE INDEX IDX_FCS_RISKCONFIG_1 ON T_FCS_RISKCONFIG ( FNUMBER );


 EXEC P_ALTERPK 'PK_FCS_RISKCONFIG_L', 'T_FCS_RISKCONFIG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKCONFIG_L_0') CREATE INDEX IDX_FCS_RISKCONFIG_L_0 ON T_FCS_RISKCONFIG_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_FCS_RISKDIAGFILTER', 'T_FCS_RISKDIAGFILTER', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKDIAGFILTER_FK') CREATE INDEX IDX_FCS_RISKDIAGFILTER_FK ON T_FCS_RISKDIAGFILTER ( FID );


 EXEC P_ALTERPK 'PK_FCS_RISKDIAGITEM', 'T_FCS_RISKDIAGITEM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKDIAGITEM_1') CREATE INDEX IDX_FCS_RISKDIAGITEM_1 ON T_FCS_RISKDIAGITEM ( FAPPBILLID );


 EXEC P_ALTERPK 'PK_FCS_RISKDIAGPARAM', 'T_FCS_RISKDIAGPARAM', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKDIAGPARAM_FK') CREATE INDEX IDX_FCS_RISKDIAGPARAM_FK ON T_FCS_RISKDIAGPARAM ( FENTRYID );


 EXEC P_ALTERPK 'PK_FCS_RISKSCREEN', 'T_FCS_RISKSCREEN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKSCREEN_1') CREATE UNIQUE INDEX IDX_FCS_RISKSCREEN_1 ON T_FCS_RISKSCREEN ( FNUMBER );


 EXEC P_ALTERPK 'PK_FCS_RISKSCREEN_L', 'T_FCS_RISKSCREEN_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKSCREEN_L_0') CREATE INDEX IDX_FCS_RISKSCREEN_L_0 ON T_FCS_RISKSCREEN_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_FCS_RISKSCREENITEMENTRY', 'T_FCS_RISKSCREENITEMENTRY', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKSCREENITEMENTRY_FK') CREATE INDEX IDX_FCS_RISKSCREENITEMENTRY_FK ON T_FCS_RISKSCREENITEMENTRY ( FENTRYID );


 EXEC P_ALTERPK 'PK_FCS_RISKSCREENMODENTRY', 'T_FCS_RISKSCREENMODENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKSCREENMODENTRY_FK') CREATE INDEX IDX_FCS_RISKSCREENMODENTRY_FK ON T_FCS_RISKSCREENMODENTRY ( FID );

 EXEC P_ALTERPK 'PK_T_FCS_ERRORDATA', 'T_FCS_ERRORDATA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_ERRORDATA') CREATE INDEX IDX_FCS_ERRORDATA ON T_FCS_ERRORDATA ( FBILLID );


 EXEC P_ALTERPK 'PK_T_FCS_ERRORDATA_ENTRY', 'T_FCS_ERRORDATA_ENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_ERRORDATA_ENTRY') CREATE INDEX IDX_FCS_ERRORDATA_ENTRY ON T_FCS_ERRORDATA_ENTRY ( FID );


 EXEC P_ALTERPK 'PK_FCS_ERRORDATA_SUBENTRY', 'T_FCS_ERRORDATA_SUBENTRY', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_ERRORDATA_SUBENTRY') CREATE INDEX IDX_FCS_ERRORDATA_SUBENTRY ON T_FCS_ERRORDATA_SUBENTRY ( FENTRYID );


 EXEC P_ALTERPK 'PK_FCS_ERRORFIELD_MAP', 'T_FCS_ERRORFIELD_MAP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_ERRORFIELD_MAP') CREATE INDEX IDX_FCS_ERRORFIELD_MAP ON T_FCS_ERRORFIELD_MAP ( FNUMBER );


 EXEC P_ALTERPK 'PK_FCS_ERRORFIELD_ENTRY', 'T_FCS_ERRORFIELD_ENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_ERRORFIELD_ENTRY') CREATE INDEX IDX_FCS_ERRORFIELD_ENTRY ON T_FCS_ERRORFIELD_ENTRY ( FID );


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