 EXEC P_ALTERPK 'PK_T_IM_INVSTATUSENTRY', 'T_IM_INVSTATUSENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_IM_OUTINVSTATUSENTRY', 'T_IM_OUTINVSTATUSENTRY', 'FENTRYID', '1';

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