EXEC P_ALTERPK 'PK_POM_MATERIALSTAGE', 'T_POM_MATERIALSTAGE', 'FID', '1';

EXEC P_ALTERPK 'PK_POM_MATERIALSTAGE_L', 'T_POM_MATERIALSTAGE_L', 'FPKID', '1';

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