Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

varchar2 to hex/octal ... convert string

4,374 views
Skip to first unread message

okey

unread,
Sep 12, 2010, 1:07:32 PM9/12/10
to
is there way to 'dump' a string (varchar2) to the screen in hex?

"this is a string" would print something like "33 44 23 64 345 43
34 ..." (I just made that up)

We started using unicode and there are a few fields that should match
but do not. We have to see below the characters printed to the
screen. Something snuck in there.

We tried using Toad's grid editor to look at this field, but it
crumps. Strange.

select char_to_hex(field) from table;

Thank you.
10g

okey

unread,
Sep 12, 2010, 1:35:01 PM9/12/10
to

Well we used C to dump it.. There are a mix of UNIX and DOS \nl
characters. We'll have to convert them all to one or the other...
Now, got to figure out that.

Michel Cadot

unread,
Sep 12, 2010, 1:57:06 PM9/12/10
to

"okey" <oldy...@yahoo.com> a écrit dans le message de news: 65276a89-c87b-408c...@n7g2000vbo.googlegroups.com...

SQL> select dump('michel',16) from dual;
DUMP('MICHEL',16)
-------------------------------
Typ=96 Len=6: 6d,69,63,68,65,6c

Regards
Michel


Mladen Gogala

unread,
Sep 13, 2010, 2:31:11 PM9/13/10
to
On Sun, 12 Sep 2010 19:57:06 +0200, Michel Cadot wrote:

> SQL> select dump('michel',16) from dual; DUMP('MICHEL',16)
> -------------------------------
> Typ=96 Len=6: 6d,69,63,68,65,6c

Just to clarify the remaining issues:
For octal dump, it's
SQL> select dump('michel',8) from dual;

DUMP('MICHEL',8)
-------------------------------------
Typ=96 Len=6: 155,151,143,150,145,154

Elapsed: 00:00:00.10

For the strictly numeric conversion, there is a good article here:
http://tkyte.blogspot.com/2009/10/httpasktomoraclecomtkytehexdec.html


--
http://mgogala.byethost5.com

Frank van Bortel

unread,
Sep 15, 2010, 4:10:14 AM9/15/10
to
select dump(column1,16) from tablea;

You owe me a cup of coffe for reading the manual for you

--

Regards,

Frank van Bortel

Frank van Bortel

unread,
Sep 15, 2010, 4:10:46 AM9/15/10
to
Oops - replied before reading all of the thread
0 new messages