awied
awied

Reputation: 2698

Searching for newlines in a Oracle DB using SQL 'like' clause

I'm trying to see if a particular column in a table in my Oracle database has any strings which contain a newline character, so a wildcard, a newline, and another wildcard.

I've tried the like command and a combination with CHR(10) and tried escaping the newline itself, but to no avail. What would be the proper way to detect a newline in somewhere within a string?

Thanks!

Upvotes: 3

Views: 9285

Answers (2)

Alex Poole
Alex Poole

Reputation: 191570

like '%'||chr(10)||'%' ought to work.

Upvotes: 13

jle
jle

Reputation: 9489

select * from yourTable where InStr(yourCol, Chr(10))>0 would work

Upvotes: 4

Related Questions