IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_OTHER' AND KSQL_COL_NAME ='FTITLE')
 ALTER TABLE T_RIM_INV_OTHER ADD (FTITLE NVARCHAR(200) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_IDB_DETAIL')
 CREATE TABLE T_RIM_IDB_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FORG_ID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDEAL_TIME DATETIME,
FQUERY_TYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARENT_CATEGORY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUB_CATEGORY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCATEGORY_SUM BIGINT DEFAULT 0 NOT NULL,
FCATEGORY_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);
