How to find non printing characters using instr and regexp_instr in Oracle databases:
Example 1
Prints first location of non-printing text and the value of the column:
select
regexp_instr(a.COL_NAME,'[^[:print:]]') as STRING_POSITION,
a.COL_NAME
from
TABLE_NAME a
where
regexp_instr(a.COL_NAME,'[^[:print:]]') > 0
;
Example 2
To focus on one of the more common non-printing characters, this query will find line feed/carriage returns in a field:
select
a.COL_NAME
from
TABLE_NAME a
where
instr(a.COL_NAME, chr(13)) != 0
or instr(a.COL_NAME, chr(10)) != 0
;
Group and filter as needed…
old… but really helpful! 🙂
thanks for the tip!