/**Begin D:\pdm\PDM_UPGRADE\pdm_new\RIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_IDB_TASK_PARAM') 
 CREATE TABLE T_RIM_IDB_TASK_PARAM (
FID BIGINT DEFAULT 0 NOT NULL,
FORG_ID BIGINT DEFAULT 0 NOT NULL,
FQUERY_TYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME,
FDATA_DATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_OVERSEA' AND KSQL_COL_NAME ='FBUYER_NAME') 
 ALTER TABLE T_RIM_INV_OVERSEA ADD (FBUYER_NAME NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_OVERSEA' AND KSQL_COL_NAME ='FSALER_NAME') 
 ALTER TABLE T_RIM_INV_OVERSEA ADD (FSALER_NAME NVARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_OVERSEA' AND KSQL_COL_NAME ='FORDER_NO') 
 ALTER TABLE T_RIM_INV_OVERSEA ADD (FORDER_NO NVARCHAR(100) DEFAULT ' ' NOT NULL );

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