EXEC P_ALTERPK 'PK_MSPLAN_ENTITY_L', 'T_MSPLAN_ENTITY_L', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_ENTITY_L_LOCAL') CREATE INDEX IDX_MSPLAN_ENTITY_L_LOCAL ON T_MSPLAN_ENTITY_L( FENTRYID,FLOCALEID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_ENTITY_L_ALIAS') CREATE INDEX IDX_MSPLAN_ENTITY_L_ALIAS ON T_MSPLAN_ENTITY_L( FMVIEWALIAS );