/**Begin C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHECKENTRY2' AND KSQL_COL_NAME IN ('FWRITEOFFFLAG')) 
 ALTER TABLE T_PUR_CHECKENTRY2 ADD (FWRITEOFFFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCK' AND KSQL_COL_NAME IN ('FWRITEOFFFLAG')) 
 ALTER TABLE T_PUR_INSTOCK ADD (FWRITEOFFFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICE' AND KSQL_COL_NAME IN ('FWRITEOFFFLAG')) 
 ALTER TABLE T_PUR_INVOICE ADD (FWRITEOFFFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RETURN' AND KSQL_COL_NAME IN ('FWRITEOFFFLAG')) 
 ALTER TABLE T_PUR_RETURN ADD (FWRITEOFFFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPT' AND KSQL_COL_NAME IN ('FWRITEOFFFLAG')) 
 ALTER TABLE T_PUR_RECEIPT ADD (FWRITEOFFFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICENTRY2' AND KSQL_COL_NAME IN ('FWRITEOFFFLAG')) 
 ALTER TABLE T_PUR_INVOICENTRY2 ADD (FWRITEOFFFLAG CHAR(1) DEFAULT '0' NOT NULL );

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