602SQL Documentation Index  

DAD - Mapping Database and XML Files

Mapping database and XML file data is described in the Document Access Definition (DAD). DAD contains references to columns in database tables (and/or variables or constants) and references to data placement in the XML file. DAD describes transformation that is performed during the transfer. The DAD can be used (generally) either way - for a transfer of XML data to the database as well as for a transfer of the data to a XML document.

The DAD is stored as an XML document internally. It may be a part of a database application as one of the objects stored in a database. The coding of this XML document (do not mistake this with XML data coding) is taken from the specified database file coding (set when creating the database).

An interactive DAD designer is included with the 602SQL Client. DAD can also be created and modified as simple text. You may also use a DAD that is not stored in the database for data transfers.

Synthetic and Analytic DAD

The DAD may be designed in one of the following ways:

The DAD type is chosen at the beginning of the design by choosing a data source. The DAD type can be changed at anytime.

If you want to create an analytic DAD, you may specify the first database table on the first page of the wizard. Other tables may be specified in elements when each occurrence refers to one database record.

A special type of analytic DAD is one that only points to variables (client or server) bound to elements or attributes.

If you want to create a synthetic DAD, you may choose any SQL query as a data source. Specify the query according to the SQL language rules in the edit field in the first page of the wizard. If the synthetic DAD should export data from a query already stored in the database, specify the TABLE keyword and the name of a stored query or table.

If you choose the "- base cursor -" for the table name, column names from the specified query will be suggested for XML output when creating the DAD. If an error occurs in the query notation, the dialog cannot be closed.

Default Design of Export to XML

If the DAD provides unstructured data transfer between a table or a query result and an XML file, a simple default design can be created automatically.

The default design contains one element for each table column in the table or query result. The element name is derived from the column name (BEWARE! cannot be used for a table containing columns, that differ only in national characters!). These elements are nested in the element that is repeated for each record. The name of this element is <row> for a synthetic DAD or identical to the table name for an analytic DAD.

The default design can be created in the design wizard.

List of topics: