SQL Reference

VARGRAPHIC

Character to Vargraphic:

>>-VARGRAPHIC--(--character-string-expression--)---------------><
 

Graphic to Vargraphic:

>>-VARGRAPHIC--(--graphic-string-expression----+-------------+-->
                                               '-,--integer--'
 
>----)---------------------------------------------------------><
 

The schema is SYSIBM.

The VARGRAPHIC function returns a graphic string representation of a:

The result of the function is a varying length graphic string (VARGRAPHIC 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 Vargraphic

character-string-expression
An expression whose value must be of a character string data type other than LONG VARCHAR or CLOB, and whose maximum length must not be greater than 16 336 bytes.

The length attribute of the result is equal to the length attribute of the argument.

Let S denote the value of the character-string-expression. Each single-byte character in S is converted to its equivalent double-byte representation or to the double-byte substitution character in the result; each double-byte character in S is mapped 'as-is'. If the first byte of a double-byte character appears as the last byte of S, it is converted into the double-byte substitution character. The sequential order of the characters in S is preserved.

The following are additional considerations for the conversion.

Graphic to Vargraphic

graphic-string-expression
An expression that returns a value that is a graphic string.

integer
The length attribute for the resulting varying length graphic string. The value must be between 0 and 16 336. If this argument is not specified, the length of the result is the same as the length of the argument.

If the length of the graphic-string-expression is greater than the length attribute of the result, truncation is performed and a warning is returned (SQLSTATE 01004) unless the truncated characters were all blanks and the graphic-string-expression was not a long string (LONG VARGRAPHIC or DBCLOB).


[ Top of Page | Previous Page | Next Page ]