SQL Reference
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 a URL (Uniform Resource
Locator).
- scheme
- For URLs this is a value such as HTTP or FILE. The value, no matter
what case it is entered in, is stored in the database in upper case. If
a value is not specified, FILE is included in the DATALINK value.
- file server name
- The complete address of the file server. The value, no matter what
case it is entered in, is stored in the database in upper case. If a
value is not specified, the file server name of the database server is
selected as default and included in the DATALINK value.
- file path
- The identity of the file within the server. The value is case
sensitive and therefore it is not converted to upper case when stored in the
database.
- access control token
- When appropriate, the access token is embedded within the file
path. It is generated dynamically and is not a permanent part of the
DATALINK value that is stored in the database.
- 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.
The characters used in a DATALINK value are limited to the set defined for
a URL. These characters include the uppercase (A through Z) and lower
case (a through z) letters, the digits (0 through 9) and a subset of special
characters ($, -, _, @, ., &, +, !, *, ", ', (, ), =, ;, /, #,
?, :, space, and comma).
The first four attributes are collectively known as the linkage
attributes. It is possible for a DATALINK value to have only a
comment attribute and no linkage attributes. Such a value may even be
stored in a column but, of course, no file will be linked to such a
column.
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:
- DATALINKs are retained in the database and both the links and the data in
the linked files can be considered as a natural extension of data in the
database.
- File reference variables exist temporarily on the client and they can be
considered as an alternative to a host program buffer.
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 | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]