/**Begin C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPAPTITUDE_FJ') 
 CREATE TABLE T_PUR_REGSUPAPTITUDE_FJ (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXAMINE_A' AND KSQL_COL_NAME ='FSRCBILLTYPE') 
 ALTER TABLE T_PUR_EXAMINE_A ADD (FSRCBILLTYPE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXAMINE_A' AND KSQL_COL_NAME ='FSRCBILLNO') 
 ALTER TABLE T_PUR_EXAMINE_A ADD (FSRCBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_EXAMINE_A' AND KSQL_COL_NAME ='FSRCBILLID') 
 ALTER TABLE T_PUR_EXAMINE_A ADD (FSRCBILLID VARCHAR(50) DEFAULT ' ' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_IMPROVE_A' AND KSQL_COL_NAME ='FSRCBILLTYPE') 
 ALTER TABLE T_PUR_IMPROVE_A ADD (FSRCBILLTYPE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_IMPROVE_A' AND KSQL_COL_NAME ='FSRCBILLNO') 
 ALTER TABLE T_PUR_IMPROVE_A ADD (FSRCBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_IMPROVE_A' AND KSQL_COL_NAME ='FSRCBILLID') 
 ALTER TABLE T_PUR_IMPROVE_A ADD (FSRCBILLID VARCHAR(50) DEFAULT ' ' NOT NULL );

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