/**Begin D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_table.sql **/
 


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_INVOICE_SERIAL') 
 CREATE TABLE T_RIM_INVOICE_SERIAL (
FID BIGINT DEFAULT 0 NOT NULL,
FSERIAL_NO VARCHAR(40) DEFAULT ' ' NOT NULL,
FAWS_SERIAL_NO VARCHAR(40) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME,
FMODIFY_TIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_RECEIVE_MESSAGE') 
 CREATE TABLE T_RIM_RECEIVE_MESSAGE (
FID BIGINT DEFAULT 0 NOT NULL,
FCLASS VARCHAR(30) DEFAULT ' ' NOT NULL,
FMETHOD VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FCREATER BIGINT DEFAULT 0 NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FSTATE VARCHAR(4) DEFAULT ' ' NOT NULL,
FREQ_MSG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREQ_MSG_TAG NCLOB,
FERROR_MSG NVARCHAR(500) DEFAULT ' ' NOT NULL,
FBIZID VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_FINANCIAL_ITEMA' AND KSQL_COL_NAME ='FAUX_ITEM_NAME') 
 ALTER TABLE T_RIM_INV_FINANCIAL_ITEMA ADD (FAUX_ITEM_NAME NVARCHAR(100) DEFAULT ' ' NOT NULL );

/**End D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_table.sql **/
