DB2 10.5 for Linux, UNIX, and Windows

DBCLOB scalar function

The DBCLOB function returns a DBCLOB representation of a graphic string type.

Read syntax diagramSkip visual syntax diagram
>>-DBCLOB--(--graphic-expression--+------------+--)------------><
                                  '-,--integer-'      

The schema is SYSIBM.

graphic-expression
An expression that returns a value that is a graphic string.
integer
An integer value specifying the length attribute of the resulting DBCLOB data type. The value must be between 0 and 1 073 741 823 if the graphic-expression string unit is double bytes or CODEUNITS16, or between 0 and 536 870 911 if graphic-expression string unit is CODEUNITS32. If integer is not specified, the length of the result is the same as the length of the first argument.
In a Unicode database, if a supplied argument is a character string, it is first converted to a graphic string before the function is executed. When the output string is truncated, such that the last character is a high surrogate, that surrogate is either:
  • Left as is, if the supplied argument is a character string
  • Converted to the blank character (X'0020'), if the supplied argument is a graphic string
Do not rely on these behaviors, because they might change in a future release.

The result of the function is a DBCLOB in the string units of graphic-expression. If the argument can be null, the result can be null; if the argument is null, the result is the null value.