IBM Books

SQL Reference

VARCHAR



Character to Varchar:

>>-VARCHAR--(--character-string-expression----+-------------+--->
                                              '-,--integer--'
 
>----)---------------------------------------------------------><
 

Datetime to Varchar:

>>-VARCHAR--(--datetime-expression--)--------------------------><
 

The schema is SYSIBM.

The VARCHAR function returns a varying-length character string representation of a character string or datetime value.

The result of the function is a varying-length string (VARCHAR data type). If the first argument can be null, the result can be null; if the first argument is null, the result is the null value.

Character to Varchar

character-string-expression
An expression whose value must be of a character-string data type with a maximum length no greater than 4 000 bytes.

integer
The length attribute for the resulting varying-length character string. The value must be between 0 and 4 000. If this argument is not specified, the length of the result is the same as the length of the argument.

Datetime to Varchar

datetime-expression
An expression whose value must be of a date, time, or timestamp data type.

Example:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]