x
login about faq Site discussion (meta-askssc)

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 3 8 10

(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 1 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.

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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x359
x50

asked: Dec 15 '09 at 06:17 PM

Seen: 925 times

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

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.