dbTalk Databases Forums  

varchar2 to hex/octal ... convert string

comp.databases.oracle.server comp.databases.oracle.server


Discuss varchar2 to hex/octal ... convert string in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
okey
 
Posts: n/a

Default varchar2 to hex/octal ... convert string - 09-12-2010 , 12:07 PM






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

Reply With Quote
  #2  
Old   
okey
 
Posts: n/a

Default Re: varchar2 to hex/octal ... convert string - 09-12-2010 , 12:35 PM






On Sep 12, 12:07*pm, okey <oldyor... (AT) yahoo (DOT) com> wrote:
Quote:
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
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.

Reply With Quote
  #3  
Old   
Michel Cadot
 
Posts: n/a

Default Re: varchar2 to hex/octal ... convert string - 09-12-2010 , 12:57 PM



"okey" <oldyork90 (AT) yahoo (DOT) com> a écrit dans le message de news: 65276a89-c87b-408c-8975-abde2b69a1e4...oglegroups.com...
Quote:
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
SQL> select dump('michel',16) from dual;
DUMP('MICHEL',16)
-------------------------------
Typ=96 Len=6: 6d,69,63,68,65,6c

Regards
Michel

Reply With Quote
  #4  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: varchar2 to hex/octal ... convert string - 09-13-2010 , 01:31 PM



On Sun, 12 Sep 2010 19:57:06 +0200, Michel Cadot wrote:

Quote:
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/ht...ytehexdec.html


--
http://mgogala.byethost5.com

Reply With Quote
  #5  
Old   
Frank van Bortel
 
Posts: n/a

Default Re: varchar2 to hex/octal ... convert string - 09-15-2010 , 03:10 AM



On 09/12/2010 07:07 PM, okey wrote:
Quote:
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
select dump(column1,16) from tablea;

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

--

Regards,

Frank van Bortel

Reply With Quote
  #6  
Old   
Frank van Bortel
 
Posts: n/a

Default Re: varchar2 to hex/octal ... convert string - 09-15-2010 , 03:10 AM



On 09/12/2010 07:57 PM, Michel Cadot wrote:
Quote:
"okey"<oldyork90 (AT) yahoo (DOT) com> a écrit dans le message de news: 65276a89-c87b-408c-8975-abde2b69a1e4...oglegroups.com...
| 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

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

Regards
Michel


Oops - replied before reading all of the thread

--

Regards,

Frank van Bortel

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.