
EXEC P_ALTERPK 'PK_FMM_TIMEUNIT', 'T_FMM_TIMEUNIT', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_TIMEUNIT_FNUMBER') CREATE INDEX IDX_FMM_TIMEUNIT_FNUMBER ON T_FMM_TIMEUNIT ( FNUMBER );


EXEC P_ALTERPK 'PK_FMM_TIMEUNIT_L', 'T_FMM_TIMEUNIT_L', 'FPKID', '1'; 

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