EBS:限定词栏的字符串中间增加了“_0x000D_”的字符问题处理

从ORACLE数据库导出 科目到EXCEL , 再从EXCEL导入 ORACLE 时, 限定词栏的字符串中 间增加了“_0x000D_”的字符。

是因为导入时,导入工具自动 把 回车符、换行符转处理了。故需要做如下处理

select tmp.compiled_value_attributes, TMP.FLEX_VALUE, TMP.FLEX_VALUE_DESCRIPTION,
instr(tmp.compiled_value_attributes,chr(10)) as ent,
replace(tmp.compiled_value_attributes,'_x000D_',chr(13)) compiled_value_attributes2
from CUX.CUX_FND_FLEX_VALUES_TMP tmp
where 1=1
--INSTR(tmp.compiled_value_attributes ,'_x000D_',1) >0
AND FLEX_VALUE= '640602'

-- 第一步: 处理限定词栏位的 "'_x000D_'"
UPDATE CUX.CUX_FND_FLEX_VALUES_TMP tmp
SET tmp.compiled_value_attributes = replace(tmp.compiled_value_attributes,'_x000D_',NULL)
where INSTR(tmp.compiled_value_attributes ,'_x000D_',1) >0
AND FLEX_VALUE= '640602'

-- 第二步:处理限定词栏位的 回车键(13),
UPDATE CUX.CUX_FND_FLEX_VALUES_TMP tmp
SET tmp.compiled_value_attributes = replace(tmp.compiled_value_attributes,chr(13),null)
where 1=1
--and INSTR(tmp.compiled_value_attributes ,'_x000D_',1) >0

AND INSTR(tmp.compiled_value_attributes,chr(13),1)>0
--AND FLEX_VALUE= '640602'

--第三步: 处理限定词栏位的 空格字(32),
UPDATE CUX.CUX_FND_FLEX_VALUES_TMP tmp
SET tmp.compiled_value_attributes = replace(tmp.compiled_value_attributes,chr(32),null)
where 1=1
AND INSTR(tmp.compiled_value_attributes,chr(32),1)>0


posted @ 2022-11-13 11:25  samrv  阅读(127)  评论(0编辑  收藏  举报