SQL Reference

DATALINK Values

A DATALINK value is an encapsulated value that contains a logical reference from the database to a file stored outside the database. The attributes of this encapsulated value are as follows:

link type
The currently supported type of link is 'URL' (Uniform Resource Locator).

data location
The location of a file linked with a reference within DB2, in the form of a URL. The allowed scheme names for this URL are:

The other parts of the URL are:

See Appendix P, BNF Specifications for DATALINKs for more information on exact BNF (Backus Naur form) specifications for DATALINKs.

comment
Up to 254 bytes of descriptive information. This is intended for application specific uses such as further or alternative identification of the location of the data.

Leading and trailing blank characters are trimmed while parsing data location attributes as URLs. Also, the scheme names ('http', 'file', 'unc', 'dfs') and host are case-insensitive and are always stored in the database in uppercase. When a DATALINK value is fetched from a database, an access token is embedded within the URL attribute when appropriate. It is generated dynamically and is not a permanent part of the DATALINK value stored in the database. For more details, see the DATALINK related scalar functions, beginning with DLCOMMENT.

It is possible for a DATALINK value to have only a comment attribute and an empty data location attribute. Such a value may even be stored in a column but, of course, no file will be linked to such a column. The total length of the comment and the data location attribute of a DATALINK value is currently limited to 200 bytes.

It should be noted that DATALINKs cannot be exchanged with a DRDA server.

It is important to distinguish between these DATALINK references to files and the LOB file reference variables described in the section entitled References to BLOB, CLOB, and DBCLOB Host Variables. The similarity is that they both contain a representation of a file. However:

Built-in scalar functions are provided to build a DATALINK value (DLVALUE) and to extract the encapsulated values from a DATALINK value (DLCOMMENT, DLLINKTYPE, DLURLCOMPLETE, DLURLPATH, DLURLPATHONLY, DLURLSCHEME, DLURLSERVER).


[ Top of Page | Previous Page | Next Page ]