Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Small example of oracle_16-to-decimal conversion

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

-- convert hexadecimal to decimal, using to_number. The parameters are hexadecimal data and are enclosed in single quotation marks.

SQL > select to_number ('ff','xx') from dual

TO_NUMBER ('FF','XX')

-

two hundred and fifty five

-- convert the decimal to hexadecimal, using to_char. The parameters are decimal data and are not enclosed in single quotation marks.

SQL > select to_char (255memexx') from dual

TO_CHAR (255pm)

-

Ff

The following error is reported because the width of the hexadecimal data to be converted is not the same as the xx width of the format string

SQL > select to_number ('10 efffffficient magnets xx') from dual

Select to_number ('10efffficient Magnum xx') from dual

ORA-01722: invalid number

-- continue, correct the width of the two is the same, no longer report an error

SQL > select to_number ('10 efffffficient Magnum 'xxxxxxxx') from dual

TO_NUMBER ("10EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

-

17760255

-- width of the format string > = the width of the data to be converted can also be

SQL > select to_number ('10 efffffficient Magnum 'xxxxxxxx') from dual

TO_NUMBER ("10EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

-

17760255

SQL > select to_number ('eBay Magazine xxxxxxxx') from dual

TO_NUMBER ('ejaculation, XXXXXXXXX')

-

fourteen

-

Copyright notice: this article is the original article of CSDN blogger "Data & Safe" and complies with the copyright agreement of CC 4.0BY-SA. Please attach the original source link and this statement for reprint.

Original link: https://blog.csdn.net/w892824196/article/details/98938379

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report