IBM SC41-5210-04 manual Vargraphic Query for iSeries function, Result Ccsid Description Character

Models: SC41-5210-04

1 294
Download 294 pages 6.42 Kb
Page 77
Image 77

VARGRAPHIC Query for iSeries function

The VARGRAPHIC scalar function provides a way to convert:

vcharacter data (SBCS and Mixed) to DBCS graphic.

vcharacter data (SBCS and Mixed) to UCS2 graphic.

vUCS2 graphic to UCS2 graphic.

vDBCS graphic to UCS2 graphic.

VARGRAPHIC ( expression

 

,

 

length DEFAULT

,ccsid

)

The VARGRAPHIC function returns a graphic string representation of a string expression.

The first argument must be a string expression and must not be bit data.

The second argument, if specified as length, is the length attribute of the result and must be an integer constant between 1 and 16370 if the first argument is not nullable or between 1 and 16369 if the first argument is nullable.

If the second argument is not specified or DEFAULT is specified, the length attribute of the result is the same as the length attribute of the first argument.

In the following rules, S denotes one of the following:

vIf the string expression is a host variable containing data in a foreign encoding scheme, S is the result of the expression after converting the data to a CCSID in a native encoding scheme.

vIf the string expression is data in a native encoding scheme, S is that string expression.

If the third argument is specified, the CCSID of the result is the third argument. It must be a DBCS or UCS2 CCSID. The CCSID cannot be 65535.

If the third argument is not specified, the CCSID of the result is determined by a mixed CCSID, let M denote that mixed CCSID. M is determined as follows:

vIf the CCSID of S is a mixed CCSID, M is that CCSID.

vIf the CCSID of S is an SBCS CCSID:

If the CCSID of S has an associated mixed CCSID, M is that CCSID.

Otherwise the operation is not allowed.

 

 

 

DBCS Substitution

M

Result CCSID

Description

Character

930

300

Japanese EBCDIC

X’FEFE’

933

834

Korean EBCDIC

X’FEFE’

935

837

S-Chinese EBCDIC

X’FEFE’

937

835

T-Chinese EBCDIC

X’FEFE’

939

300

Japanese EBCDIC

X’FEFE’

5026

4396

Japanese EBCDIC

X’FEFE’

5035

4396

Japanese EBCDIC

X’FEFE’

The result of the function is a varying-length graphic string. If the expression can be null, the result can be null. If the expression is null, the result is the null value. If the expression is an empty string or the EBCDIC string X’0E0F’, the result is an empty string.

Chapter 5. Defining result fields in Query for iSeries 65

Page 77
Image 77
IBM SC41-5210-04 manual Vargraphic Query for iSeries function, Result Ccsid Description Character