IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_TRIPCHANGETRAVEL')
 CREATE TABLE T_ER_TRIPCHANGETRAVEL (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);

EXEC P_ALTERPK 'PK_ER_TRIPCHANGETRAVEL', 'T_ER_TRIPCHANGETRAVEL', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_TRIPCHANGETRAVEL_FID') CREATE INDEX IDX_ER_TRIPCHANGETRAVEL_FID ON T_ER_TRIPCHANGETRAVEL ( FENTRYID );
