Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

extract records with esc type sequences

AnnieMFeb 11 2019 — edited Feb 20 2019

Hi,

I need to extract records from all fields where an escape type sequence exists, including carriage returns and line feeds.


I have this query (as an example) where I capture the obvious escape sequences in our tables (as a pre-validation step prior to data conversion to a new database).

select * from amm_ais_tbl_info

where table_comments like '%'||chr(10)|| '%' or table_comments like '%'||chr(13)|| '%' OR table_comments like '%'||chr(9)|| '%' OR table_comments like '%'||chr(92)|| '%'

;

chr(10):     line feed

chr(13):     carriage return

chr(9):       horizontal tab

chr(92):     backslash \ 

But would that cover all possible escape sequences? If it would, then the query above is fine I think.

Would REGEXP_LIKE be better? I have never used that and unsure how to set it up for this. I did see the following posts on REGEXP_LIKE. However, setting up the queries using the examples did not return what I expected.

https://community.oracle.com/message/13937666#13937666

Thank you and I hope your day is a good one,

This post has been answered by Frank Kulash on Feb 11 2019
Jump to Answer
Comments
Post Details
Added on Feb 11 2019
17 comments
459 views