Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting RAW datatype to VARCHAR2

User_OMEF8Sep 29 2016 — edited Sep 30 2016

Hello Gurus!

I know that this may sound like a simple task and it was until I encountered an issue that I am not sure how to go about. I know Oracle has a built-in function called UTL_RAW and I have used it to convert my RAW datatype, but it does not work on another column that I want to convert.

Oracle version 11.2.0.1.0

| Column Name | Datatype |
| NAMES | RAW (200 BYTE) |
| INFO | RAW (96 BYTE) |

--This is a SELECT statement that executes on the value of the NAMES column

select utl_raw.cast_to_varchar2(hextoraw('8400010043005F004900430043005F004100500049006E0076006F0069006300650073005F0043006F006C006C0065006300740069006F006E005F0031003000300031002E0032003000310034002D00300033002D00300038002D00300030002D00340030002D00340033005F003100300038003900340035003400390032002E007400690066000000')) from dual;

The above query gives me a result of...

varchar2.JPG

--This is a SELECT statement that executes on the value of the INFO column

select utl_raw.cast_to_varchar2(hextoraw('00441D7F0000000048480000000000002870B1587197904496910D7B7D6565BE')) from dual;

The above query gives me a result of...

info.JPG

If I run a DUMP on both columns, they look similar.

NAMES

Typ=23 Len=138: (then it has a lot of different numbers and such)

INFO

Typ=23 Len=32: (then it has a lot of different numbers and such)

Question: why does it work on the NAMES RAW column but not on the INFO RAW column? Is there some thing that I am missing?

If you need more information, then please feel free to ask. Thanks in advance for your help and suggestions.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 28 2016
Added on Sep 29 2016
9 comments
13,232 views