IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_TRIPCHANGEHISTORY')
 CREATE TABLE T_ER_TRIPCHANGEHISTORY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFROMPLACEID BIGINT DEFAULT 0 NOT NULL,
FTOPLACEID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FVEHICLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FTRIPEXPENSEITEMID BIGINT DEFAULT 0 NOT NULL,
FENTRYCOSTDEPTID BIGINT DEFAULT 0 NOT NULL,
FENTRYCOSTCOMPANYID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FORIAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTRIPAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTRIPORIACCAPPAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTRIPACCAPPAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTRIPCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISTRIPMULCURRENCY CHAR(1) DEFAULT '0' NOT NULL,
FSRCENTRYDATA NCLOB,
FSRCENTRYDATA_TAG NCLOB,
FSRCENTRYID BIGINT DEFAULT 0 NOT NULL,
FCHANGER BIGINT DEFAULT 0 NOT NULL,
FCHANGEDATE DATETIME
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REQBILL' AND KSQL_COL_NAME ='FISCHANGE')
 ALTER TABLE T_ER_REQBILL ADD (FISCHANGE CHAR(1) DEFAULT '0' NOT NULL );
