views:

52

answers:

2

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!

+1  A: 

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

jle
+1 for extreme cases I'd expect this solution to perform a little better than using LIKE
Jeffrey Kemp
+2  A: 

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

Alex Poole
Worked like a charm. Thanks!
awied