# chr(10) chr(13)

## Goal

how to identify carriage return and line feed in a table

## Solution

Depending on the platform, a newline will generally either be a CHR(10) (Unix) or a CHR(13) followed by a CHR(10) (Windows):

unix平台：chr(10)

win平台：chr(13)||chr(10)

\n is line feed(换行), \r is carriage return（回车）

\r = chr(13)　回车

\n = chr(10)　换行

You can use the CHR function to look for the ASCII value as below query:

SQL> select * from where like '%'||chr(10)||'%';
SQL> select * from  where like '%'||chr(13)||'%';

create table tgtest3 (id number, name clob);
insert into tgtest3(id,name) values(1,'hdhd:'||chr(10)||'d');
insert into tgtest3(id,name) values(2,'hdhd:'||chr(10)||chr(13)||'d');
insert into tgtest3(id,name) values(3,'hdhd:'||chr(13)||'d');
insert into tgtest3(id,name) values(4,'hdhd:'||chr(13)||chr(10)||'d');
select * from tgtest3 a where a.name like '%'||chr(13)||'%';
select * from oracle.tgtest3;
select 'a'||chr(13)||'b'||chr(13)||'c'　name from dual;
select 'a'||chr(10)||'b'||chr(10)||'c' name from dual;
select 'a'||chr(10)||'b'||chr(13)||'c' name from dual;
select 'a'||chr(13)||'b'||chr(10)||'c' name from dual;

• 博文量
81
• 访问量
225686