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
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
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).