/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\POM_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROORDER' AND KSQL_COL_NAME ='FENTITYTYPE') 
 ALTER TABLE T_POM_MROORDER ADD (FENTITYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROORDER' AND KSQL_COL_NAME ='FISSHOWLIST') 
 ALTER TABLE T_POM_MROORDER ADD (FISSHOWLIST CHAR(1) DEFAULT '0' NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROORDERENTRY' AND KSQL_COL_NAME ='FEXECONDITION') 
 ALTER TABLE T_POM_MROORDERENTRY ADD (FEXECONDITION BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROORDERENTRY' AND KSQL_COL_NAME ='FISOM') 
 ALTER TABLE T_POM_MROORDERENTRY ADD (FISOM CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROORDERENTRY' AND KSQL_COL_NAME ='FMATERIELMTC') 
 ALTER TABLE T_POM_MROORDERENTRY ADD (FMATERIELMTC BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROORDERENTRY' AND KSQL_COL_NAME ='FPRIORITY') 
 ALTER TABLE T_POM_MROORDERENTRY ADD (FPRIORITY BIGINT DEFAULT 0 NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_MULTYPEID') 
 CREATE TABLE T_POM_MULTYPEID (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID VARCHAR(36) DEFAULT ' ' NOT NULL
);

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