Skip to Main Content
  • Questions
  • How to determine ascii value of character in column

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Neil.

Asked: November 24, 2009 - 7:55 pm UTC

Last updated: November 26, 2009 - 10:23 am UTC

Version: 10.2.0.4

Viewed 10K+ times! This question is

You Asked

Hi Tom

I have a column called position that contains some special character, but I cant work out what it is.

When I use sqlplus to query the column, the value appears as a '?'
When I use Toad is appears as a '-'

The problem is it is causing an excel report that I create using SYLK to fail with ora-6502 character buffer string too small.

I'd like to be able to print out the ascii value of each character (or just the special character) from that column.

I'm not so great at sql, but I think I would use a combination of ascii and instr in some loop for the length of the value in the column?

Many thanks

Neil

and Tom said...


ops$tkyte%ORA11GR2> select username, dump(username) d from all_users where rownum = 1;

USERNAME                       D
------------------------------ ----------------------------------------
SYS                            Typ=1 Len=3: 83,89,83



just use the dump builtin - it'll show you character by character what is there.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Tom Interactive !

DJB, November 26, 2009 - 10:28 am UTC

Wow, this is an experience.

Worked perfectly for me

A reader, November 10, 2017 - 12:39 pm UTC

I neede to know EXACTLY what was in a particular column my table. I googled it. This was the 1st result and it worked perfectly.
Thanks