In this article, I am going to discuss ConversionFunctionsinOracle with Examples. Please read our previous article where we discussed Date Functions in Oracle with Examples. At the end of this article, you will understand the following OracleConversionFunctions with examples.
Oracle PL/SQL provides several conversionfunctions that can be used to convert one data type to another. These functions are useful when you need to store data in a specific format or when you need to convert data for use in another application.
This Oracle tutorial explains how to use the Oracle / PLSQL CONVERTfunction with syntax and examples. The Oracle / PLSQL CONVERTfunction converts a string from one character set to another.
Select order date using different date formats. Test date conversionfunctions using DUAL. Select various character-based date formats and convert the values to dates. Test number conversionfunctions using DUAL. Select various character-based numeric formats and convert the values to numbers.
Oracle discourages the use of the CONVERTfunction in the current Oracle Database release. The return value of CONVERT has a character data type, so it should be either in the database character set or in the national character set, depending on the data type.
On this diagram you can see how they can be used to convert between the different data types: number, character, and date. Note that you can't convert between numbers and dates directly, but need to convert to a character value first.
The OracleCONVERTfunction doesn't do what you might expect it do, if you just look at its name. Learn what this function does and how to use it in this article.