How to find Exact Position and control character i.e ASCII code in a column of a table in Oracle

 

Identify Exact Position and Code  in a Column of a table

If you want to see the position and ASCII code of non-printable characters:

SELECT LEVEL AS position,
       SUBSTR(n2, LEVEL, 1) AS character,
        ASCII(SUBSTR(n2, LEVEL, 1)) AS ascii_val
FROM abcd
WHERE (ASCII(SUBSTR(n2, LEVEL, 1)) <=31 OR ASCII(SUBSTR(n2, LEVEL, 1))=127 )
CONNECT BY LEVEL <= LENGTH(n2);
If you remove Where condition then it will display all the characters in that column
Heare Replace n2   - with your column Name  and  abcd -  with your Table Name
Example : 


Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post