EXEC P_ALTERPK 'PK_FMM_QUERYMAPPING_SET', 'T_FMM_QUERYMAPPING_SET', 'FID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_QUERNG_FNUMBER') CREATE INDEX IDX_FMM_QUERNG_FNUMBER ON T_FMM_QUERYMAPPING_SET( FNUMBER );
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_QUERNG_FCREATETIME') CREATE INDEX IDX_FMM_QUERNG_FCREATETIME ON T_FMM_QUERYMAPPING_SET( FCREATETIME );

EXEC P_ALTERPK 'PK_FMM_QUERYMAPPING_SET_L', 'T_FMM_QUERYMAPPING_SET_L', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_QUERNGL_FID') CREATE INDEX IDX_FMM_QUERNGL_FID ON T_FMM_QUERYMAPPING_SET_L( FID,FLOCALEID );
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_QUERNGL_FNAME') CREATE INDEX IDX_FMM_QUERNGL_FNAME ON T_FMM_QUERYMAPPING_SET_L( FNAME );

EXEC P_ALTERPK 'PK_FMM_QMSEENTRY', 'T_FMM_QMSET_ENTRY', 'FENTRYID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_QMSEET_FID') CREATE INDEX IDX_FMM_QMSEET_FID ON T_FMM_QMSET_ENTRY( FID,FSEQ );