DLVALUE

The DLVALUE function returns a DataLink value. When the function is on the right hand side of a SET clause in an UPDATE statement or is in a VALUES clause in an INSERT statement, it usually also creates a link to a file. However, if only a comment is specified (in which case the data-location is a zero-length string), the DataLink value is created with empty linkage attributes so there is no file link.

Read syntax diagramSkip visual syntax diagramDLVALUE (data-location,linktype-string,comment-string)
data-location
If the link type is URL, then this is a character string expression that contains a complete URL value. If the expression is not an empty string, it must include the URL scheme and URL server. The actual length of the character string expression must be less than or equal to 32718 characters.
linktype-string
An optional character string expression that specifies the link type of the DataLink value. The only valid value is 'URL'.
comment-string
An optional character string expression that provides a comment or additional location information. The actual length of the character string expression must be less than or equal to 254 characters.

The comment-string cannot be the null value. If a comment-string is not specified, the comment-string is the empty string.

If the first argument can be null, the result can be null; if the first argument is null, the result is the null value.

The result of the function is a DataLink value.

The CCSID of the DataLink is the same as that of data-location except in the following cases:

  • If the comment string is mixed data and data-location is not mixed data, the CCSID of the result will be the CCSID of the comment string.1
  • If the data-location has a CCSID of bit data (65535), UTF-16 graphic data (1200), UCS-2 graphic data (13488), Turkish data (905 or 1026), or Japanese data (290, 930, or 5026); the CCSID of the result is described in the following table:
    CCSID of data-location CCSID of comment-string Result CCSID
    65535 65535 Job Default CCSID
    65535 non-65535 comment-string CCSID (unless the CCSID is 290, 930, 5026, 905, 1026, or 13488 where the CCSID will then be further modified as described in the following rows.)
    290 any 4396
    930 or 5026 any 939
    905 or 1026 any 500
    1200 any 500
    13488 any 500

When defining a DataLink value using this function, consider the maximum length of the target of the value. For example, if a column is defined as DataLink(200), then the maximum length of the data-location plus the comment is 200 bytes.

Examples

  • Insert a row into the table. The URL values for the first two links are contained in the variables named url_article and url_snapshot. The variable named url_snapshot_comment contains a comment to accompany the snapshot link. There is, as yet, no link for the movie, only a comment in the variable named url_movie_comment.
      INSERT INTO HOCKEY_GOALS
        VALUES('Maurice Richard',
               'Montreal canadian',
               '?',
               'Boston Bruins,
               '1952-04-24',
               'Winning goal in game 7 of Stanley Cup final',
               DLVALUE(:url_article),
               DLVALUE(:url_snapshot, 'URL', :url_snapshot_comment),
               DLVALUE('', 'URL', :url_movie_comment) )
1 If the CCSID of comment string is 5026 or 930, the CCSID of the results will be 939.