IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_DTX_LOCAL_TX_LOG')
CREATE TABLE T_DTX_LOCAL_TX_LOG (
    FID BIGINT DEFAULT 0 NOT NULL,
    FXID VARCHAR(100) DEFAULT ' ' NOT NULL,
    FSEQ INT DEFAULT 0 NOT NULL,
    FCLOUD_ID VARCHAR(100) DEFAULT ' ' NOT NULL,
    FAPP_ID VARCHAR(100) DEFAULT ' ' NOT NULL,
    FRESOURCE VARCHAR(100) DEFAULT ' ' NOT NULL,
    FPARA_TYPE VARCHAR(1000) DEFAULT ' ' NOT NULL,
    FPARAS NCLOB,
    FCODE VARCHAR(100) DEFAULT ' ' NOT NULL,
    FBIZID NCLOB DEFAULT NULL,
    FCREATE_TIME DATETIME,
    FPARAS_BYTES BLOB 
    );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_DTX_LOCAL_TX_LOG' AND KSQL_COL_NAME = 'FSTATUS') ALTER TABLE T_DTX_LOCAL_TX_LOG ADD (FSTATUS INT DEFAULT 0 NOT NULL);