/**Begin C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME IN ('FISCONTROLQTY')) 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FISCONTROLQTY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTRATEDOWN')) 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FSALOUTRATEDOWN DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTRATEUP')) 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FSALOUTRATEUP DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTQTYDOWN')) 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FSALOUTQTYDOWN DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTBASEQTYDOWN')) 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FSALOUTBASEQTYDOWN DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTQTYUP')) 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FSALOUTQTYUP DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME IN ('FSALOUTBASEQTYUP')) 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FSALOUTBASEQTYUP DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME IN ('FBASICUNITID')) 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FBASICUNITID BIGINT DEFAULT 0 NOT NULL );

/**End C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
