
 EXEC P_ALTERPK 'PK_PMTS_PLAN_MODEL', 'T_PMTS_PLAN_MODEL', 'FID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMTS_PLAN_FNUMBER') CREATE INDEX IDX_PMTS_PLAN_FNUMBER ON T_PMTS_PLAN_MODEL ( FNUMBER );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMTS_PLAN_FCREATETIME') CREATE INDEX IDX_PMTS_PLAN_FCREATETIME ON T_PMTS_PLAN_MODEL ( FCREATETIME );
 
 
 EXEC P_ALTERPK 'PK_PMTS_PLAN_MODEL_L', 'T_PMTS_PLAN_MODEL_L', 'FPKID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMTS_PLANL_FID') CREATE INDEX IDX_PMTS_PLANL_FID ON T_PMTS_PLAN_MODEL_L ( FID,FLOCALEID );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMTS_PLANL_FNAME') CREATE INDEX IDX_PMTS_PLANL_FNAME ON T_PMTS_PLAN_MODEL_L ( FNAME );
 
 
 EXEC P_ALTERPK 'PK_PMTS_TASKTPENTRYENTITYS', 'T_PMTS_TASKTPENTRYENTITYS', 'FENTRYID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMTS_TASKYS_FID') CREATE INDEX IDX_PMTS_TASKYS_FID ON T_PMTS_TASKTPENTRYENTITYS ( FID );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PMTS_TASKYS_FSEQ') CREATE INDEX IDX_PMTS_TASKYS_FSEQ ON T_PMTS_TASKTPENTRYENTITYS ( FSEQ );


