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

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RECORD_H_DESTID') CREATE INDEX IDX_RECORD_H_DESTID ON T_FCS_PAYACCESS_RECORD_H ( FISREPEATRESULT ,FISEXCESSRESULT ,FDESTBILLID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RECORD_H_SRCPKID') CREATE INDEX IDX_RECORD_H_SRCPKID ON T_FCS_PAYACCESS_RECORD_H ( FSRCBILLPKID );


 EXEC P_ALTERPK 'PK_T_FCS_ARCHIVERECORD', 'T_FCS_ARCHIVERECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PK_T_FCS_ARCHIVERECORD_NUM') CREATE INDEX IDX_PK_T_FCS_ARCHIVERECORD_NUM ON T_FCS_ARCHIVERECORD ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_FCS_ARCHIVESETTING', 'T_FCS_ARCHIVESETTING', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_ARCHIVESETTING_L', 'T_FCS_ARCHIVESETTING_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_PAYTRACELOG_H', 'T_FCS_PAYTRACELOG_H', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_REPEATCTRLLOG_H', 'T_FCS_REPEATCTRLLOG_H', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_FCS_PAYACCESS_RECORD_H_L', 'T_FCS_PAYACCESS_RECORD_H_L', 'FPKID', '1';

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

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