Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non Printable Characters

Status
Not open for further replies.

manmaria

Technical User
Aug 8, 2003
286
US
We have some non printable characters in column for a table. How to find them?

thanks
 
Do you know which chars?
You can specify Hex-values by adding XC,
e.g. '0D0A'XC is CR/LF

So
col LIKE ANY ('0A'XC, '0D'XD,...)
should work

Dieter
 
I don't know what is there but I know it is neither null nor spaces.
Is there any way to display them?

Thanks for your response,
 
The only way i can think of is to use all possible chars within LIKE ANY.
I forgot the percent char in my first example, so it's quite ugly:
col LIKE ANY ('%'|| '00'xc || '%', '%'|| '01'xc || '%',...)

IIRC the percent sign is '25'xc, so this could be rewritten as:
col LIKE ANY ('250125'xc, '250125'xc,...)

A more elegant solution is to create a table with a single char column, populate it with all non-printable chars and then use a subquery within LIKE:
col LIKE ANY (select '%'|| charcol || '%' from mytable)

As long as your data isn't UNICODE, this should be efficient...

Dieter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top