4. Understanding the Elements of SQL Statements : Expressions in SQL : CAST Expressions
 
Share this page                  
CAST Expressions
An alternative to using CASE and DECODE for conversions is the CAST expression. Cast expressions coerce the source expression into the indicated data type. They can appear anywhere that other forms of expression can.
They are specified as follows:
CAST (expr AS datatype)
where expr is the source value expression and datatype is any supported data type.
Example:
SELECT CAST(CURRENT_TIME AS TIME(9) WITH TIME ZONE);