天天看點

oracle插入、替換回車換行\r\n

回車是光标回到目前行的開頭,換行是光标停在目前位置的下一行,結合就是下一行的開頭。

如果直接插入\r\n,查出來的資料就是"\r\n",是'\''r''\''n'4個字元。

oracle中回車是chr(13)--\r,換行符是chr(10)--\n。

插入:

insert into testtable(id, name, val, memo) values (1, 'testinsert1', '123'||chr(13)||chr(10)||'456', '測試插入回車換行');

替換("\r\n"換成chr(13)chr(10) ):

update testtable t set t.val = replace(t.val,'\r\n', chr(13)||chr(10) ) where t.name = 'testreplace1';