/**Begin C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICENTRY2_A' AND KSQL_COL_NAME IN ('FENTRYPAYTYPE')) 
 ALTER TABLE T_PUR_INVOICENTRY2_A ADD (FENTRYPAYTYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHECKENTRY2' AND KSQL_COL_NAME IN ('FBUSINESSTYPEID')) 
 ALTER TABLE T_PUR_CHECKENTRY2 ADD (FBUSINESSTYPEID BIGINT DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHECKENTRY2_A' AND KSQL_COL_NAME IN ('FENTRYEXCHRATE')) 
 ALTER TABLE T_PUR_CHECKENTRY2_A ADD (FENTRYEXCHRATE DECIMAL(23,10) DEFAULT 1 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHECKENTRY2_A' AND KSQL_COL_NAME IN ('FENTRYLOCCURR')) 
 ALTER TABLE T_PUR_CHECKENTRY2_A ADD (FENTRYLOCCURR BIGINT DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICENTRY2_A' AND KSQL_COL_NAME IN ('FENTRYEXCHRATE')) 
 ALTER TABLE T_PUR_INVOICENTRY2_A ADD (FENTRYEXCHRATE DECIMAL(23,10) DEFAULT 1 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICENTRY2_A' AND KSQL_COL_NAME IN ('FENTRYLOCCURR')) 
 ALTER TABLE T_PUR_INVOICENTRY2_A ADD (FENTRYLOCCURR BIGINT DEFAULT 1 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_PAY' AND KSQL_COL_NAME IN ('FFEE')) 
 ALTER TABLE T_PUR_PAY ADD (FFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
/**End C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
