IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AUDIT_TRACE_LOG')
CREATE TABLE T_AUDIT_TRACE_LOG (
    FID BIGINT DEFAULT 0 NOT NULL,
    FINDEX VARCHAR(100) DEFAULT ' ' NOT NULL,
    FINSTANCEID VARCHAR(100) DEFAULT ' ' NOT NULL,
    FAPPNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
    FMESSAGE NCLOB,
    FSUMMARY VARCHAR(1000) DEFAULT ' ' NOT NULL,
    FLOGTAGS VARCHAR(1000) DEFAULT ' ' NOT NULL,
    FLOGTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
    FTRACEBD BIGINT DEFAULT 0 NOT NULL,
    FCOUNT BIGINT DEFAULT 0 NOT NULL,
    FTIMESTAMP DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AUDIT_TRACE_BD')
CREATE TABLE T_AUDIT_TRACE_BD (
    FID BIGINT DEFAULT 0 NOT NULL,
    FNUMBER VARCHAR(1000) DEFAULT ' ' NOT NULL,
    FNAME VARCHAR(1000) DEFAULT ' ' NOT NULL,
    FLOGTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
    FBDTYPE  VARCHAR(50) DEFAULT ' ' NOT NULL,
    FENABLED CHAR(50) DEFAULT '1' NOT NULL,
    FSTATUS CHAR(50) DEFAULT 'A' NOT NULL
);