 EXEC p_AlterPK 'PK_AP_IM_DETAIL', 'T_AP_IM_DETAIL', 'FID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AP_IM_DETAIL' AND KSQL_INDNAME = 'IDX_AP_IM_DETAIL_MRID')
 CREATE INDEX IDX_AP_IM_DETAIL_MRID ON T_AP_IM_DETAIL (FMATCHRECORDID );


 EXEC p_AlterPK 'PK_AP_IM_DETAILENTRY', 'T_AP_IM_DETAILENTRY', 'FENTRYID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AP_IM_DETAILENTRY' AND KSQL_INDNAME = 'IDX_AP_IM_ENTRY_FID')
 CREATE INDEX IDX_AP_IM_ENTRY_FID ON T_AP_IM_DETAILENTRY (FID );


