/**Begin D:\PDM_UPGRADE\PDM1\FPM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_FPM_REPORTPLANSUM', 'T_FPM_REPORTPLANSUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPM_REPORTPLANSUM') CREATE INDEX IDX_FPM_REPORTPLANSUM ON T_FPM_REPORTPLANSUM ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SUMPLAN_REPORTORG') CREATE INDEX IDX_SUMPLAN_REPORTORG ON T_FPM_REPORTPLANSUM ( FREPORTORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SUMPLAN_REPORTPERIOD') CREATE INDEX IDX_SUMPLAN_REPORTPERIOD ON T_FPM_REPORTPLANSUM ( FREPORTPERIODID );


 EXEC P_ALTERPK 'PK_T_FPM_REPORTPLANSUM_C', 'T_FPM_REPORTPLANSUM_C', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPM_REPORTPLANSUM_C') CREATE INDEX IDX_FPM_REPORTPLANSUM_C ON T_FPM_REPORTPLANSUM_C ( FID );


 EXEC P_ALTERPK 'PK_T_FPM_REPORTPLANSUM_L', 'T_FPM_REPORTPLANSUM_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPM_REPORTPLANSUM_L') CREATE INDEX IDX_FPM_REPORTPLANSUM_L ON T_FPM_REPORTPLANSUM_L ( FID );


 EXEC P_ALTERPK 'PK_T_FPM_PLANSUM_ATTACHTPL', 'T_FPM_PLANSUM_ATTACHTPL', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPM_PLANSUM_ATTACHTPL') CREATE INDEX IDX_FPM_PLANSUM_ATTACHTPL ON T_FPM_PLANSUM_ATTACHTPL ( FID );


 EXEC P_ALTERPK 'PK_T_FPM_PLANSUM_PERIOD', 'T_FPM_PLANSUM_PERIOD', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPM_PLANSUM_PERIOD') CREATE INDEX IDX_FPM_PLANSUM_PERIOD ON T_FPM_PLANSUM_PERIOD ( FID );



/**End D:\PDM_UPGRADE\PDM1\FPM_constraint.sql **/
