/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PDM_constraint.sql **/
 EXEC P_ALTERPK 'PK_FMM_QUOTACATEGORY_L', 'T_FMM_QUOTACATEGORY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_QUOTACATEGORY_L') CREATE INDEX IDX_FMM_QUOTACATEGORY_L ON T_FMM_QUOTACATEGORY_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_FMM_QUOTACATEGORY', 'T_FMM_QUOTACATEGORY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_QUOTACATEGORY_NUMBER') CREATE INDEX IDX_FMM_QUOTACATEGORY_NUMBER ON T_FMM_QUOTACATEGORY ( FNUMBER);
 
 EXEC P_ALTERPK 'PK_FMM_PURQUOTA_L', 'T_FMM_PURQUOTA_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PURQUOTA_L') CREATE INDEX IDX_FMM_PURQUOTA_L ON T_FMM_PURQUOTA_L ( FID ,FLOCALEID );
 
  EXEC P_ALTERPK 'PK_FMM_PURQUOTA', 'T_FMM_PURQUOTA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_PURQUOTA_NUMBER') CREATE INDEX IDX_FMM_PURQUOTA_NUMBER ON T_FMM_PURQUOTA ( FNUMBER);
 
   EXEC P_ALTERPK 'PK_FMM_PURQUOTAENTRY', 'T_FMM_PURQUOTAENTRY', 'FENTRYID', '1';

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


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