EXEC P_ALTERPK 'PK_FMM_PERSGROUP', 'T_FMM_PERSGROUP', 'FID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PERSGROUP_FNUM') CREATE INDEX IDX_FMM_PERSGROUP_FNUM ON T_FMM_PERSGROUP (FNUMBER);

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PERSGROUP_FCT') CREATE INDEX IDX_FMM_PERSGROUP_FCT ON T_FMM_PERSGROUP (FCREATETIME);


EXEC P_ALTERPK 'PK_FMM_PERSGROUP_L', 'T_FMM_PERSGROUP_L', 'FPKID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PERSGROUP_L_FID') CREATE INDEX IDX_FMM_PERSGROUP_L_FID ON T_FMM_PERSGROUP_L (FID,FLOCALEID);

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PERSUPL_L_FNAME') CREATE INDEX IDX_FMM_PERSUPL_L_FNAME ON T_FMM_PERSGROUP_L (FNAME);