/**Begin D:\pdm\PDM_UPGRADE\pdm_new\RIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_QUERY_CONFIG') 
 CREATE TABLE T_RIM_QUERY_CONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FQUERYTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FINVOICETYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCONFIGTYPE NVARCHAR(4) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_QUERY_CONFIG_ITEM') 
 CREATE TABLE T_RIM_QUERY_CONFIG_ITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FITEMKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSHOW CHAR(1) DEFAULT ' ' NOT NULL,
FITEMNAME NVARCHAR(200) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_QUERY_CONFIG_ITEM_L') 
 CREATE TABLE T_RIM_QUERY_CONFIG_ITEM_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FMULILANGTEXTFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNAME NVARCHAR(200) DEFAULT ' ' NOT NULL
);


/**End D:\pdm\PDM_UPGRADE\pdm_new\RIM_table.sql **/
