oracle sql - 查询以查找特殊字符
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7478883/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
oracle sql - query to find special chars
提问by iko
Is there any SQL SELECT query that can be done in oracle to detect ascii characters such as LF, CR in fields? Basically any characters people have known to cause trouble in a oracle db environment in terms of breaking jobs/procedures.etc
是否有任何 SQL SELECT 查询可以在 oracle 中完成以检测字段中的 LF、CR 等 ASCII 字符?基本上,人们所知道的任何字符都会在 oracle db 环境中在破坏作业/过程等方面造成麻烦
I doubt this would work: - happy to use regex if possible
我怀疑这是否可行: - 如果可能,很乐意使用正则表达式
select * from table
where column like '%chr(13)%'
回答by zerkms
select * from table
where regexp_like(column, '(' || chr(13) || '|' || chr(10) || ')')
The regex used here is a form of (a|b|c)
which matches the string if it contains a OR b OR c
这里使用的正则表达式是(a|b|c)
匹配字符串的一种形式,如果它包含a OR b OR c