FirebirdSQL logo

CAST()

Converts a value from one data type to another

Result type

As specified by target_type

Syntax
CAST (<expression> AS <target_type>)

<target_type> ::= <domain_or_non_array_type> | <array_datatype>

<domain_or_non_array_type> ::=
  !! See Scalar Data Types Syntax !!

<array_datatype> ::=
  !! See Array Data Types Syntax !!
Table 1. CAST Function Parameters
Parameter Description

expression

SQL expression

sql_datatype

SQL data type

CAST converts an expression to the desired data type or domain.If the conversion is not possible, an error is raised.