EXEC P_ALTERPK 'PK_FMM_WORKGROUPTYPE', 'T_FMM_WORKGROUPTYPE', 'FID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_WORKGROUPTYPE_FNUM') CREATE INDEX IDX_FMM_WORKGROUPTYPE_FNUM ON T_FMM_WORKGROUPTYPE (FNUMBER);

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


EXEC P_ALTERPK 'PK_FMM_WORKGROUPTYPE_L', 'T_FMM_WORKGROUPTYPE_L', 'FPKID', '1';
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_WORKGROUPTYPE_L_FID') CREATE INDEX IDX_FMM_WORKGROUPTYPE_L_FID ON T_FMM_WORKGROUPTYPE_L (FID,FLOCALEID);

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