MrB*_*les 2 database oracle replace nclob
我们在NCLOB类型的Oracle数据库中有信息,我想删除换行符.例如,这不起作用:
MyNclobCell := REPLACE(MyNclobCell, '\n', '');
Run Code Online (Sandbox Code Playgroud)
我在下面有答案吗?是的,是的我做到了!
原来我需要删除换行符(\n,ascii:10)和回车符(\ r,ascii:13).要使用上面的示例,一行代码变为两行,如下所示:
MyNclobCell := REPLACE(MyNclobCell, chr(10), '');
MyNclobCell := REPLACE(MyNclobCell, chr(13), '');
Run Code Online (Sandbox Code Playgroud)
然后,我将NCLOB行全部放在一行中,并将内容粘贴到电子表格中,并将其交给请求者,万岁!
更新:根据Saurabh Patil的建议,代码高尔夫球手和单线游戏的替代语法:
REPLACE(REPLACE(MyNclobCell, chr(10), ''), chr(13), '');
Run Code Online (Sandbox Code Playgroud)