Conversion of a number from decimal to hexa decimal?

Is there any function in oracle to convert decimal values to hexa decimal values? or do we need to create our own userdefined function for this?

more ▼

asked Dec 15, 2009 at 06:17 PM in Default

avatar image

131 9 10 14

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Converting to Hexadecimal

Does Oracle have a function or an easy way to convert hexadecimal to decimal or decimal to hexadecimal?

As a matter of fact, since Oracle8i Release 8.1.5, we do. It is a simple to_number/to_char format mask for numbers. You can use the query select to_number( 'AA', 'xx' ) from dual; to convert from hexadecimal to decimal and select to_char( 111, 'xxxx' ) from dual to convert from decimal to hexadecimal.

Oracle Resource

Check CONVERT function as well

Oracle Resource

more ▼

answered Dec 15, 2009 at 06:34 PM

avatar image

Tariq Rahiman
665 2 4 7

The first link helped me to do this. But the second one it seems, there is no option using CONVERT function to do that. Thank you so much Tariq Rahiman!!

Dec 15, 2009 at 07:05 PM dbkid
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Dec 15, 2009 at 06:17 PM

Seen: 1867 times

Last Updated: Dec 15, 2009 at 06:17 PM

Copyright 2016 Redgate Software. Privacy Policy