 EXEC P_ALTERPK 'PK_FMM_PLANSEGMENT', 'T_FMM_PLANSEGMENT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PLANSEGMENT_FRESID') CREATE INDEX IDX_FMM_PLANSEGMENT_FRESID  ON T_FMM_PLANSEGMENT ( FRESOURCEPLANID );
 
 
 EXEC P_ALTERPK 'PK_FMM_PLANSEGENTRY', 'T_FMM_PLANSEGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PLANSEGENTRY_FSEQ') CREATE INDEX IDX_FMM_PLANSEGENTRY_FSEQ  ON T_FMM_PLANSEGENTRY ( FID,FSEQ );
 

