Converting Data Types

From InterBase
Jump to: navigation, search

Go Up to Specifying Data Types


Normally, you must use compatible data types to perform arithmetic operations, or to compare data in search conditions. If you need to perform operations on mixed data types, or if your programming language uses a data type that is not supported by InterBase, then data type conversions must be performed before the database operation can proceed. InterBase either automatically (dialect 1) converts the data to an equivalent data type (an implicit type conversion), or you can use the CAST() function (dialect 3) in search conditions to explicitly translate one data type into another for comparison purposes.

You cannot convert array data to any other data type, nor can any data type be converted to an array. Individual elements of an array, however, behave like members of the array’s base data type. To see how BLOBs can be converted to VARCHARS, see Using BLOBs with VARCHAR Data.

Topics