简体   繁体   English

oracle DB SQL 上的特殊字符

[英]Special Characters on oracle DB SQL

Currently we are using this code to identify several rows which contain special characters.目前我们正在使用此代码来识别包含特殊字符的几行。 But it seems it's not capturing some events.但它似乎没有捕捉到一些事件。 Could you please share the optimized script to use for this scenario.您能否分享用于此场景的优化脚本。

regexp_like(column_name, '^[^a-zA-Z]*$') then 'number'
regexp_like(column_name, '^[^g-zG-Z]*$') then 'hex'

If the string can have multiple characters, then you need to take this into account:如果字符串可以有多个字符,那么您需要考虑到这一点:

regexp_like(column_name, '^[0-9]+$') as is_integer
regexp_like(column_name, '^[0-9A-Fa-f]+$') as is_hex

Of course, both of these could be true.当然,这两种情况都可能是真的。

I would suggest the shorter versions:我建议使用较短的版本:

regexp_like(column_name, '^\d+$') as is_integer
regexp_like(column_name, '^[[:xdigit:]]+$') as is_hex

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM