/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT' AND KSQL_COL_NAME IN ('FBIDCOUNT')) 
 ALTER TABLE T_SRC_PROJECT ADD (FBIDCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT' AND KSQL_COL_NAME IN ('FTERMINALNODE')) 
 ALTER TABLE T_SRC_PROJECT ADD (FTERMINALNODE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_APPLYENTRY' AND KSQL_COL_NAME IN ('FBASEUNITID')) 
 ALTER TABLE T_SRC_APPLYENTRY ADD (FBASEUNITID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_APPLYENTRY' AND KSQL_COL_NAME IN ('FBASEQTY')) 
 ALTER TABLE T_SRC_APPLYENTRY ADD (FBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_QUESTION' AND KSQL_COL_NAME IN ('FCURRENTNODE')) 
 ALTER TABLE T_SRC_QUESTION ADD (FCURRENTNODE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_TIMECHG' AND KSQL_COL_NAME IN ('FPLANOPENDATE')) 
 ALTER TABLE T_SRC_TIMECHG ADD (FPLANOPENDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_TIMECHG' AND KSQL_COL_NAME IN ('FNEWPLANOPENDATE')) 
 ALTER TABLE T_SRC_TIMECHG ADD (FNEWPLANOPENDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_NEGOTIATEBILL' AND KSQL_COL_NAME IN ('FBIDCOUNT')) 
 ALTER TABLE T_SRC_NEGOTIATEBILL ADD (FBIDCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_NEGOTIATEBILL' AND KSQL_COL_NAME IN ('FCURRENTNODE')) 
 ALTER TABLE T_SRC_NEGOTIATEBILL ADD (FCURRENTNODE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_NOTYEARINFO' AND KSQL_COL_NAME IN ('FBASEUNITID')) 
 ALTER TABLE T_SRC_NOTYEARINFO ADD (FBASEUNITID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_NOTYEARINFO' AND KSQL_COL_NAME IN ('FBASEQTY')) 
 ALTER TABLE T_SRC_NOTYEARINFO ADD (FBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDCHANGE' AND KSQL_COL_NAME IN ('FCURRENTNODE')) 
 ALTER TABLE T_SRC_BIDCHANGE ADD (FCURRENTNODE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_O' AND KSQL_COL_NAME IN ('FISREGIONCONTROL')) 
 ALTER TABLE T_SRC_PROJECT_O ADD (FISREGIONCONTROL CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY_F' AND KSQL_COL_NAME IN ('FCFMBASEQTY')) 
 ALTER TABLE T_SRC_PURLISTENTRY_F ADD (FCFMBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CONTRACTENTRY_A' AND KSQL_COL_NAME IN ('FDELIVERDATE')) 
 ALTER TABLE T_SRC_CONTRACTENTRY_A ADD (FDELIVERDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CONTRACTENTRY_A' AND KSQL_COL_NAME IN ('FROWTYPEID')) 
 ALTER TABLE T_SRC_CONTRACTENTRY_A ADD (FROWTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CONTRACTENTRY_A' AND KSQL_COL_NAME IN ('FBASEUNITID')) 
 ALTER TABLE T_SRC_CONTRACTENTRY_A ADD (FBASEUNITID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CONTRACTENTRY_A' AND KSQL_COL_NAME IN ('FBASEQTY')) 
 ALTER TABLE T_SRC_CONTRACTENTRY_A ADD (FBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CONTRACTENTRY_A' AND KSQL_COL_NAME IN ('FCFMBASEQTY')) 
 ALTER TABLE T_SRC_CONTRACTENTRY_A ADD (FCFMBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CONTRACTENTRY_A' AND KSQL_COL_NAME IN ('FCONTRACTBASEQTY')) 
 ALTER TABLE T_SRC_CONTRACTENTRY_A ADD (FCONTRACTBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CONTRACTENTRY_A' AND KSQL_COL_NAME IN ('FORDERBASEQTY')) 
 ALTER TABLE T_SRC_CONTRACTENTRY_A ADD (FORDERBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_NEWARCHIVEFILE_FJ') 
 CREATE TABLE T_SRC_NEWARCHIVEFILE_FJ (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);



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