CAST function in Oracle

CAST is one of the vital Conversion functions of Oracle. It is used to convert a datatype to another. The CAST function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g and Oracle 9i.

Syntax:

CAST ( {expression | ( subquery ) | MULTISET ( subquery ) } AS type_name )

Example:

select CAST( '26-Jun-2019' AS VARCHAR2(50) )
from dual;

Explanation: The date will be converted into a VARCHAR2(50) value.

Please follow and like us:
Content Protection by DMCA.com