EXEC P_ALTERPK 'PK_T_PUR_SALREJECTREASONATT', 'T_PUR_SALREJECTREASONATT', 'FPKID', '1';

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