-- T_FA_MASTERID_UPGRADE_LOG表相关语句
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_MASTERID_UPGRADE_LOG') 
 CREATE TABLE T_FA_MASTERID_UPGRADE_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FCOST INT DEFAULT 0 NOT NULL,
FTOTAL INT DEFAULT 0 NOT NULL,
FBIZSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FERRORMSG VARCHAR(50) DEFAULT ' ' NOT NULL,
FERRORMSG_TAG NCLOB DEFAULT ' ',
FALREADY INT DEFAULT 0 NOT NULL
);

EXEC P_ALTERPK 'PK_T_FA_MASTERID_UPGRADE_LOG', 'T_FA_MASTERID_UPGRADE_LOG', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_MAS_UPG_BILLTYPE') CREATE INDEX IDX_FA_MAS_UPG_BILLTYPE ON T_FA_MASTERID_UPGRADE_LOG ( FBILLTYPE );