SQL Reference

DATALINK Assignments

The assignment of a value to a DATALINK column results in the establishment of a link to a file unless the linkage attributes of the value are empty or the column is defined with NO LINK CONTROL. In cases where a linked value already exists in the column, that file is unlinked. Assigning a null value where a linked value already exists also unlinks the file associated with the old value.

If the application provides the same data location as already exists in the column, the link is retained. There are two reasons that this might be done:

A DATALINK value may be assigned to a column in any of the following ways:

When assigning a value to a DATALINK column, the following error conditions return SQLSTATE 428D1:

When the assignment is also creating a link, the following errors can occur:

In addition, when the assignment removes an existing link, the following errors can occur:

A DATALINK value may be retrieved from the database in either of the following ways:

Note that usually no attempt is made to access the file server at retrieval time. 17 It is therefore possible that subsequent attempts to access the file server through file system commands might fail.

When retrieving a DATALINK, the registry of file servers at the database server is checked to confirm that the file server is still registered with the database server (SQLSTATE 55022). In addition, a warning may be returned when retrieving a DATALINK value because the table is in reconcile pending or reconcile not possible state (SQLSTATE 01627).


Footnotes:

17
It may be necessary to access the file server to determine the prefix name associated with a path. This can be changed at the file server when the mount point of a file system is moved. First access of a file on a server will cause the required values to be retrieved from the file server and cached at the database server for the subsequent retrieval of DATALINK values for that file server. An error is returned if the file server cannot be accessed (SQLSTATE 57050).


[ Top of Page | Previous Page | Next Page ]