SQL Reference

Appendix P. BNF Specifications for DATALINKs

A DATALINK value is an encapsulated value that contains a logical reference from the database to a file stored outside the database.

The data-location attribute of this encapsulated value is a logical reference to a file in the form of a Uniform Resource Locator (URL). The value of this attribute conforms to the syntax for URLs as specified by the following BNF 119 , based on RFC 1738 : Uniform Resource Locators (URL), T. Berners-Lee, L. Masinter, M. McCahill, December 1994

The following conventions are used in the BNF specification:

The BNF specification for DATALINKs:

URL

url          =    httpurl | fileurl | uncurl | dfsurl | emptyurl   

HTTP

httpurl      =    "http://" hostport [ "/" hpath ]  
hpath        =    hsegment *[ "/" hsegment ]  
hsegment     =    *[ uchar | ";" | ":" | "@" | "&" | "=" ]

Note that the search element from the original BNF in RFC1738 has been removed, because it is not an essential part of the file reference and does not make sense in DATALINKs context.

FILE

fileurl      =    "file://" host "/" fpath  
fpath        =    fsegment *[ "/" fsegment ]  
fsegment     =    *[ uchar | "?" | ":" | "@" | "&" | "=" ] 

Note that host is not optional and the "localhost" string does not have any special meaning, in contrast with RFC1738. This avoids confusing interpretations of "localhost" in client/server and EEE configurations.

UNC

uncurl       =    "unc:\\" hostname "\" sharename "\" uncpath  
sharename    =    *uchar  
uncpath      =    fsegment *[ "\" fsegment ]

Supports the commonly used UNC naming convention on NT. This is not a standard scheme in RFC1738.

DFS

dfsurl        =   "dfs://.../" cellname "/" fpath  
cellname      =   hostname

Supports the DFS naming scheme. This is not a standard scheme in RFC1738.

EMPTYURL

emptyurl     =    "" 
hostport     =    host [ ":" port ] 
host         =    hostname | hostnumber  
hostname     =    *[ domainlabel "." ] toplabel  
domainlabel  =    alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit  
toplabel     =    alpha | alpha *[ alphadigit | "-" ] alphadigit  
alphadigit   =    alpha | digit  
hostnumber   =    digits "." digits "." digits "." digits  
port         =    digits

Empty (zero-length) URLs are also supported for DATALINK values. These are useful to update DATALINK columns when reconcile exceptions are reported and non-nullable DATALINK columns are involved. A zero-length URL is used to update the column and cause unlink

Miscellaneous Definitions

lowalpha      =   "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" |
                  "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" |
                  "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" |
                  "y" | "z"
hialpha       =   "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" |
                  "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" |
                  "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" |
                  "Y" | "Z"
alpha         =   lowalpha | hialpha 
digit         =   "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
                  "8" | "9"
safe          =   "$" | "-" | "_" | "." | "+"
extra         =   "!" | "*" | "'" | "(" | ")" | ","
hex           =   digit | "A" | "B" | "C" | "D" | "E" | "F" |
                  "a" | "b" | "c" | "d" | "e" | "f"
escape        =   "%" hex hex  
unreserved    =   alpha | digit | safe | extra  
uchar         =   unreserved | escape  
digits        =   1*digit     

Leading and trailing blank characters are trimmed by DB2 while parsing. Also, the scheme names ('HTTP', 'FILE', 'UNC', 'DFS') and host are case-insensitive, and are always stored in the database in uppercase.


Footnotes:

119
BNF is an acronym for "Backus Naur Form" - a formal notation to describe the syntax of a given language


[ Top of Page | Previous Page | Next Page ]