/**BEGIN E:\NEXTERP_PDM\PDM_UPGRADE\PDMS\BRANCH_LASTEST\PDM\POM_CONSTRAINT.SQL **/

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_pom_mftorderentry_s' AND KSQL_COL_NAME ='FENTRUSTDEPT')
 ALTER TABLE t_pom_mftorderentry_s ADD (FENTRUSTDEPT BIGINT DEFAULT 0 NOT NULL);
 
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_pom_xmftorderentry_s' AND KSQL_COL_NAME ='FENTRUSTDEPT')
 ALTER TABLE t_pom_xmftorderentry_s ADD (FENTRUSTDEPT BIGINT DEFAULT 0 NOT NULL);

/**END E:\NEXTERP_PDM\PDM_UPGRADE\PDMS\BRANCH_LASTEST\PDM\POM_CONSTRAINT.SQL **/