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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPM_ORGREPORTTYPE') CREATE INDEX IDX_FPM_ORGREPORTTYPE ON T_FPM_ORGREPORTTYPE ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_FPM_ORGREPORTTYPE_L', 'T_FPM_ORGREPORTTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_BODYSYSMANAGE_L', 'T_FPM_BODYSYSMANAGE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_BODYSYSMANAGE_MANG', 'T_FPM_BODYSYSMANAGE_MANG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_BODYSYSMANAGE_TYPE', 'T_FPM_BODYSYSMANAGE_TYPE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_DETAILPLANFIELD', 'T_FPM_DETAILPLANFIELD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPM_DETAILPLANFIELD') CREATE INDEX IDX_FPM_DETAILPLANFIELD ON T_FPM_DETAILPLANFIELD ( FBODYSYS );


 EXEC P_ALTERPK 'PK_T_FPM_DETAILPLANFIELD_L', 'T_FPM_DETAILPLANFIELD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_DETAILPLANFIELD_ENT', 'T_FPM_DETAILPLANFIELD_ENT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_DIMENSIONMEMBER', 'T_FPM_DIMENSIONMEMBER', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPM_DIMENSIONMEMBER') CREATE INDEX IDX_FPM_DIMENSIONMEMBER ON T_FPM_DIMENSIONMEMBER ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_FPM_DIMENSIONMEMBER_L', 'T_FPM_DIMENSIONMEMBER_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_DIMENSIONMEMBER_ENT', 'T_FPM_DIMENSIONMEMBER_ENT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FPM_BODYSYSMANAGE', 'T_FPM_BODYSYSMANAGE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPM_BODYSYSMANAGE') CREATE INDEX IDX_FPM_BODYSYSMANAGE ON T_FPM_BODYSYSMANAGE ( FNUMBER );



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