x

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 '09 at 06:17 PM in Default

dbkid gravatar image

dbkid
131 8 10 11

(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 '09 at 06:34 PM

Tariq Rahiman gravatar image

Tariq Rahiman
665 2 2 4

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 '09 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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

SQL Server Central

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

Topics:

x375
x50

asked: Dec 15 '09 at 06:17 PM

Seen: 1396 times

Last Updated: Dec 15 '09 at 06:17 PM