/**Begin C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPCATEGORY' AND KSQL_COL_NAME IN ('FMATERIAL')) 
 ALTER TABLE T_PUR_SUPCATEGORY ADD (FMATERIAL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPCATEGORY' AND KSQL_COL_NAME IN ('FCATEGORYTYPE')) 
 ALTER TABLE T_PUR_SUPCATEGORY ADD (FCATEGORYTYPE CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPCATEGORY' AND KSQL_COL_NAME IN ('FISSOURCELIST')) 
 ALTER TABLE T_PUR_SUPCATEGORY ADD (FISSOURCELIST CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SUPCATEGORY' AND KSQL_COL_NAME IN ('FSYNCHROSOURCELIST')) 
 ALTER TABLE T_PUR_SUPCATEGORY ADD (FSYNCHROSOURCELIST CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CATEGORYCHGENTRY' AND KSQL_COL_NAME IN ('FCATEGORYTYPE')) 
 ALTER TABLE T_PUR_CATEGORYCHGENTRY ADD (FCATEGORYTYPE CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CATEGORYCHGENTRY' AND KSQL_COL_NAME IN ('FMATERIAL')) 
 ALTER TABLE T_PUR_CATEGORYCHGENTRY ADD (FMATERIAL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CATEGORYCHGENTRY' AND KSQL_COL_NAME IN ('FISSOURCELIST')) 
 ALTER TABLE T_PUR_CATEGORYCHGENTRY ADD (FISSOURCELIST CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APPROVEENTRY' AND KSQL_COL_NAME IN ('FCATEGORYTYPE')) 
 ALTER TABLE T_PUR_APPROVEENTRY ADD (FCATEGORYTYPE CHAR(1) DEFAULT 'B' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APPROVEENTRY' AND KSQL_COL_NAME IN ('FMATERIAL')) 
 ALTER TABLE T_PUR_APPROVEENTRY ADD (FMATERIAL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_APPROVEENTRY' AND KSQL_COL_NAME IN ('FISSOURCELIST')) 
 ALTER TABLE T_PUR_APPROVEENTRY ADD (FISSOURCELIST CHAR(1) DEFAULT '0' NOT NULL );

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