In Oracle, you can use the "to_number()" function to convert hexadecimal to decimal data. This function is used to convert strings into numerical formats, and the parameters within the function need to be used Enclosed in single brackets, the syntax is "select to_number('hexadecimal number','xx') from dual".
The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.
TO_NUMBER function () is one of the commonly used type conversion functions in Oracle. It mainly converts strings into numerical formats. It is exactly the opposite of the TO_CHAR() function.
The format of the To_number function is as follows:
To_number(varchar2 or char,’format model’)
Convert hexadecimal to decimal,
use to_number, the parameters inside are hexadecimal data, and the parameters are in single Examples of
SQL> select to_number('ff','xx') from dual; TO_NUMBER('FF','XX') -------------------- 255
enclosed in quotation marks are as follows:
##Expand knowledge:
--10 in To convert system to hexadecimal, use to_char, the parameters inside are decimal data, and the parameters do not need to be enclosed in single quotesSQL> select to_char(255,'xx') from dual; TO_CHAR(255,'XX') ----------------- ff
Oracle Video Tutorial"
The above is the detailed content of How to convert hexadecimal to decimal in Oracle. For more information, please follow other related articles on the PHP Chinese website!