/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RATIOCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_RATIOCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RATIOCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_RATIOCHG ADD (FCHGSRCBILLID 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 ('FORGID')) 
 ALTER TABLE T_SRC_TIMECHG ADD (FORGID 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 ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_TIMECHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_WINNUMCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_WINNUMCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_WINNUMCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_WINNUMCHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLIST' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_PURLIST ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLIST' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_PURLIST ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CATEGORYCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_CATEGORYCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CATEGORYCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_CATEGORYCHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DECISIONCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_DECISIONCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DECISIONCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_DECISIONCHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_F' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_PROJECT_F ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_F' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_PROJECT_F ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MONEYCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_MONEYCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MONEYCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_MONEYCHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_OPENAPPLY' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_OPENAPPLY ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_OPENAPPLY' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_OPENAPPLY ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_ORDERCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_ORDERCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_ORDERCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_ORDERCHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PRICECHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_PRICECHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PRICECHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_PRICECHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECTEND' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_PROJECTEND ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECTEND' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_PROJECTEND ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURORGCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_PURORGCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURORGCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_PURORGCHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RESDETAILS' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_RESDETAILS ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RESDETAILS' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_RESDETAILS ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMANDCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_DEMANDCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMANDCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_DEMANDCHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SUPPLIERINVALID' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_SUPPLIERINVALID ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SUPPLIERINVALID' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_SUPPLIERINVALID ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MATERIALCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_MATERIALCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MATERIALCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_MATERIALCHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEMECHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_SCHEMECHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEMECHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_SCHEMECHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMANDQTYCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_DEMANDQTYCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMANDQTYCHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_DEMANDQTYCHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MATERIALEND' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_MATERIALEND ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MATERIALEND' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_MATERIALEND ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RETENDER' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_RETENDER ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RETENDER' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_RETENDER ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDSCHEMECHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_BIDSCHEMECHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDSCHEMECHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_BIDSCHEMECHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDDOC_CHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_BIDDOC_CHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDDOC_CHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_BIDDOC_CHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECTMANCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_PROJECTMANCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECTINFOCHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_PROJECTINFOCHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RATIOTYPECHG' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_SRC_RATIOTYPECHG ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RATIOTYPECHG' AND KSQL_COL_NAME IN ('FCHGSRCBILLID')) 
 ALTER TABLE T_SRC_RATIOTYPECHG ADD (FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL );

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