EXEC P_ALTERPK 'PK_T_PUR_CHECREJECTREASONATT', 'T_PUR_CHECREJECTREASONATT', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CHECREJECTATT_FBASEDATAID') CREATE INDEX IDX_CHECREJECTATT_FBASEDATAID ON T_PUR_CHECREJECTREASONATT ( FBASEDATAID );


EXEC P_ALTERPK 'PK_T_PUR_INVREJECTREASONATT', 'T_PUR_INVREJECTREASONATT', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_INVREJECTATT_FBASEDATAID') CREATE INDEX IDX_INVREJECTATT_FBASEDATAID ON T_PUR_INVREJECTREASONATT ( FBASEDATAID );


EXEC P_ALTERPK 'PK_T_PUR_ORDEREJECTREASONATT', 'T_PUR_ORDEREJECTREASONATT', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ORDERREJECTATT_FBASEDATAID') CREATE INDEX IDX_ORDERREJECTATT_FBASEDATAID ON T_PUR_ORDEREJECTREASONATT ( FBASEDATAID );