EXEC P_ALTERPK 'PK_FMM_AREA', 'T_FMM_AREA', 'FID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AREA_FNUM') CREATE INDEX IDX_FMM_AREA_FNUM ON T_FMM_AREA (FNUMBER);

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


EXEC P_ALTERPK 'PK_FMM_AREA_L', 'T_FMM_AREA_L', 'FPKID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AREA_L_FID') CREATE INDEX IDX_FMM_AREA_L_FID ON T_FMM_AREA_L (FID,FLOCALEID);

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


EXEC P_ALTERPK 'PK_FMM_AREAPROPERTY', 'T_FMM_AREAPROPERTY', 'FID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AREAPROPERTY_FNUM') CREATE INDEX IDX_FMM_AREAPROPERTY_FNUM ON T_FMM_AREAPROPERTY (FNUMBER);

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


EXEC P_ALTERPK 'PK_FMM_AREAPROPERTY_L', 'T_FMM_AREAPROPERTY_L', 'FPKID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AREAPROPERTY_L_FID') CREATE INDEX IDX_FMM_AREAPROPERTY_L_FID ON T_FMM_AREAPROPERTY_L (FID,FLOCALEID);

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