IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SOLIDIFY_MSG') 
 CREATE TABLE T_BD_SOLIDIFY_MSG (
FID BIGINT DEFAULT 0 NOT NULL,
FBITDATA BLOB,
FENTITY VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FOPTIME DATETIME,
FSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FOPTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FOPUSERID BIGINT DEFAULT 0 NOT NULL
);


 
 EXEC P_ALTERPK 'PK_T_BD_SOLIDIFY_MSG', 'T_BD_SOLIDIFY_MSG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SOLIDIFY_MSG_FUSEORGID') CREATE INDEX IDX_BD_SOLIDIFY_MSG_FUSEORGID ON T_BD_SOLIDIFY_MSG ( FUSEORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SOLIDIFY_MSG_FENTITY') CREATE INDEX IDX_T_BD_SOLIDIFY_MSG_FENTITY ON T_BD_SOLIDIFY_MSG ( FENTITY );
