/**Begin D:\PDM_UPGRADE\PDM1\FCS_constraint.sql **/
 EXEC P_ALTERPK 'PK_FCS_PAYACCESS_L', 'T_FCS_PAYACCESS_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_FCS_PAYACCESS_SET_L', 'T_FCS_PAYACCESS_SET_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_PAYACCESS_RECORD_L', 'T_FCS_PAYACCESS_RECORD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_FCS_PAYACCESS_BL_L', 'T_FCS_PAYACCESS_BL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_PAYACCESS', 'T_FCS_PAYACCESS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FCS_PAYACCESS') CREATE INDEX IDX_T_FCS_PAYACCESS ON T_FCS_PAYACCESS ( FNUMBER ,FENABLE );


 EXEC P_ALTERPK 'PK_T_FCS_PAYACCESS_SET', 'T_FCS_PAYACCESS_SET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FCS_PAYACCESS_SET') CREATE INDEX IDX_T_FCS_PAYACCESS_SET ON T_FCS_PAYACCESS_SET ( FENABLE );


 EXEC P_ALTERPK 'PK_T_FCS_PAYACCESS_RECORD', 'T_FCS_PAYACCESS_RECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FCS_PAYACCESS_RECORD') CREATE INDEX IDX_T_FCS_PAYACCESS_RECORD ON T_FCS_PAYACCESS_RECORD ( FNUMBER ,FENABLE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RECORD_DESTPKID') CREATE INDEX IDX_RECORD_DESTPKID ON T_FCS_PAYACCESS_RECORD ( FDESTBILLPKID );


 EXEC P_ALTERPK 'PK_T_FCS_PAYACCESS_BL', 'T_FCS_PAYACCESS_BL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FCS_PAYACCESS_BL') CREATE INDEX IDX_T_FCS_PAYACCESS_BL ON T_FCS_PAYACCESS_BL ( FENABLE ,FDESTENTITYID );


 EXEC P_ALTERPK 'PK_T_FCS_PAYTRACELOG', 'T_FCS_PAYTRACELOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FCS_PAYTRACELOG_BILLNUM') CREATE INDEX IDX_T_FCS_PAYTRACELOG_BILLNUM ON T_FCS_PAYTRACELOG ( FBILLNUMBER );


 EXEC P_ALTERPK 'PK_T_FCS_CHECKCTRL_L', 'T_FCS_CHECKCTRL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_REPEATCTRL_WL', 'T_FCS_REPEATCTRL_WL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_REPEATCTRL_WL') CREATE INDEX IDX_FCS_REPEATCTRL_WL ON T_FCS_REPEATCTRL_WL ( FNUMBER ,FENABLE );


 EXEC P_ALTERPK 'PK_T_FCS_REPEATCTRL_WL_L', 'T_FCS_REPEATCTRL_WL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_CHECKCTRL_AMTCTRL', 'T_FCS_CHECKCTRL_AMTCTRL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_CHECKCTRL_SUBAMT', 'T_FCS_CHECKCTRL_SUBAMT', 'FDETAILID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_CHECKCTRL', 'T_FCS_CHECKCTRL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FCS_CHECKCTRL') CREATE INDEX IDX_T_FCS_CHECKCTRL ON T_FCS_CHECKCTRL ( FENABLE ,FCTRLENTITYID );


 EXEC P_ALTERPK 'PK_T_FCS_REPEATCTRLLOG', 'T_FCS_REPEATCTRLLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FCS_REPEATCTRLLOG_SRCID') CREATE INDEX IDX_T_FCS_REPEATCTRLLOG_SRCID ON T_FCS_REPEATCTRLLOG ( FSOURCEBILLID );



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