/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FPM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_FPM_REPORT', 'T_FPM_REPORT', 'FID', '1';

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

 EXEC P_ALTERPK 'PK_T_FPM_REPORT_L', 'T_FPM_REPORT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_REPORTDATADETAIL', 'T_FPM_REPORTDATADETAIL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_REPORTDATAMAIN', 'T_FPM_REPORTDATAMAIN', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_REPORT_CURRENCY', 'T_FPM_REPORT_CURRENCY', 'FPKID', '1';

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



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FPM_constraint.sql **/
