Saving Recordsets As Xml; Datashaping - Omron CX-SUPERVISOR - V2.0 User Manual

Table of Contents

Advertisement

CHAPTER 12 – Databases

Saving Recordsets as XML

Using the DBExecute() 'Save' command any Recordset may be saved as an XML file, to be imported
in to another application. XML resembles and complements HTML. XML describes data, such as
city name, temperature and barometric pressure, and HTML defines tags that describe how the data
should be displayed, such as with a bulleted list or a table. XML, however, allows developers to
define an unlimited set of tags, bringing great flexibility to authors, who can decide which data to use
and determine its appropriate standard or custom tags.
Example: XML is used to describe an Employees phone list:
<EmployeeList>
</EmployeeList>
You can use an application with a built in XML parser, such as Microsoft® Internet Explorer 5 to
view XML documents in the browser just as you would view HTML pages.

Datashaping

The ADO SHAPE command can be used to produce hierarchical recordsets i.e. where a value within
the current record is used to access another Recordset. For example, a record showing Customer
Details might contain a field for Customer ID. Every time the record position is changed, a child
Recordset showing Orders for that Customer ID could be recreated.
Hierarchical recordsets present an alternative to using JOIN syntax when accessing parent-child data.
Hierarchical recordsets differ from a JOIN in that with a JOIN, both the parent table fields and child
table fields are represented in the same recordset. With a hierarchical recordset, the recordset
contains only fields from the parent table. In addition, the recordset contains an extra field that
represents the related child data, which you can assign to a second recordset variable and traverse.
Hierarchical recordsets are made available via the MSDataShape provider, which is implemented by
the client cursor engine.
A new clause, SHAPE, is provided to relate SELECT statements in a hierarchical fashion. The
syntax is summarized below:
Page 212
<Entry>
<Employee>John Jones</Employee>
<Phone>555-1213</Phone>
<Type>Mobile</Type>
</Entry>
<Entry>
<Employee>Sally Mae</Employee>
<Phone>555-1217</Phone>
<Type>Business Fax</Type>
</Entry>
OMRON
Release 2.0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 2.0

Table of Contents