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

How to realize implicit data type conversion in Oracle

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces how to achieve implicit data type conversion in Oracle, which is very detailed and has a certain reference value. Interested friends must read it!

Implicit data type conversion

If possible, you can implicitly convert values whose data types do not match the data types of the parameters required by the function to the desired format. VARCHAR2 and CHAR data types are collectively referred to as character types. Character fields are very flexible, allowing almost all types of information to be stored. Therefore, you can easily convert DATE and number values to their character forms. These conversions are called number-to-character (number to character) and date-to-character (date to character) conversions.

Select length (1234567890) from dual

Select length (0123456789) from dual

Select length (sysdate) from dual;.

It is not common to implicitly convert character data to a numeric data type, because the only condition for this is that the character data represents a valid number.

You can convert implicit characters to a date (character to date) when the string conforms to the following date format: [d | DD] separator1 [MON | MONTH] separator2 [R | RR | YY | date]. D and DD represent the first and second digits of the month, respectively. MON is the three-character abbreviation of the month, while MONTH is the full name of the month. R and RR denote satisfactory and 2-digit years, respectively. YY and YYYY represent 2-digit and 4-digit years, respectively. Separator1 and separator2 elements can be most punctuation, spaces, and tabs.

'24murJANMUE 09' DD-MON-RR

'1\ january/8' D\\ MONTH/R

'13The Janus 8' DD*MON*R

'13Universe febmax 2008' DD/MON/YYYY

'01$ jan/08' DD$MON/RR

'24-JAN-09 18pur45' DD-MON-RR HH24:MI

The above is all the content of the article "how to achieve implicit data type conversion in Oracle". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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

Development

Wechat

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

12
Report