1.1

Table Of Contents
Integer to character syntax
CHAR (IntegerExpression )
An expression that returns a value that is an integer data type (either
SMALLINT, INTEGER or BIGINT).
IntegerExpression
The result is the character string representation of the argument in the form of an SQL integer constant. The
result consists of n characters that are the signicant digits that represent the value of the argument with a
preceding minus sign if the argument is negative. It is left justied.
If the rst argument is a small integer: The length of the result is 6. If the number of characters in the result is
less than 6, then the result is padded on the right with blanks to length 6.
If the rst argument is a large integer: The length of the result is 11. If the number of characters in the result
is less than 11, then the result is padded on the right with blanks to length 11.
If the rst argument is a big integer: The length of the result is 20. If the number of characters in the result is
less than 20, then the result is padded on the right with blanks to length 20.
Datetime to character syntax
CHAR (DatetimeExpression )
An expression that is one of the following three data types:DatetimeExpression
date: The result is the character representation of the date. The length of the result is
10.
time: The result is the character representation of the time. The length of the result is
8.
timestamp: The result is the character string representation of the timestamp. The
length of the result is 26.
Decimal to character
CHAR (DecimalExpression )
An expression that returns a value that is a decimal data type. If a different precision
and scale is desired, the DECIMAL scalar function can be used rst to make the
change.
DecimalExpression
Floating point to character syntax
CHAR (FloatingPointExpression )
An expression that returns a value that is a oating-point data type
(DOUBLE or REAL).
FloatingPointExpression
Example
Use the CHAR function to return the values for EDLEVEL (dened as smallint) as a xed
length character string:
SELECT CHAR(EDLEVEL) FROM EMPLOYEE
vFabric SQLFire User's Guide548
vFabric SQLFire Reference