The Import Database Data command enables you to import data from any of a variety of databases into an XML file. The import mechanism involves two steps:
|1.||A connection to the database is established. For instructions, see Connecting to a Database.|
To import database data, do the following:
|1.||When you click the Import Database Data command, the Import Database Data dialog (screenshot below) pops up.|
|2.||Select Convert Database Data into XML and click OK. The Connect to a Data Source dialog appears. (The Map Database Data into XML Based on Existing DTD/Schema option requires the use of Altova MapForce to carry out the mapping.)|
|3.||In the Connect to Data Source dialog, you establish a connection to the database. For instructions, see Connecting to a Database.|
|4.||After the connection to the database is established, the Import Database Data dialog displays tabs and windows that enable you to select the database data to import. These options are described below. After finishing, click the Import button to import the database data.|
The Import Database Data dialog for setting the selection and import options consists of two parts (shown separately in the screenshots below):
|•||an upper part with two tabs: (i) Selection, and (ii) Options.|
|•||a lower part, which is a Preview window showing the data according to the data selection and import options.|
In the Selection tab (screenshot above), the Source pane (screenshot below) displays either a representation of the tables of the database or an editable SQL statement for selecting the required tables, each view being selected by clicking the respective radio button.
In the Table view, you can select the tables in the database that you want to import by checking the table's check box (screenshot above). The contents of the table can then be displayed in the Preview pane. The table selection can be further filtered in the Preview pane (see below).
The database structure can be displayed differently and can be filtered. The Layout icon in the Source pane enables you to organize database objects into: (i) folders based on object type; (ii) folders based on object type, but without schema folders; (iii) in a hierarchy, but without folders; and (iv) categories of tables, based on their relationships with other tables.
Clicking the Filter Folder Contents icon applies a filter to the selected folder (in the screenshot below, to the Tables folder). Clicking the filter icon on the table pops out a menu with a list of filter possibilities. In the screenshot below, the filter has been set to display objects that contain the text Sys in its name. The view is filtered accordingly.
Clicking the Object Locator icon pops up a text field, which behaves like a Search entry field. You can enter a text string and the dropdown list will display all the objects whose names contain that text string. Selecting one of these objects from the dropdown list will highlight that object in the tree.
In the Options tab (screenshot below), you can specify how number, date, and time values are to be imported; whether data is imported as elements or attributes; and whether comments and NULL fields are to be included in the import.
When NULL fields are enabled for import, you can enter a substitution XML value for them.
The Preview pane (screenshot below) displays the structure of the table currently selected in the Selection tab. When a new table is selected in the Selection tab, click the Preview button in the Preview pane to display the table. Click the Reload button to refresh the preview.
A field can be specified to be imported as an element or attribute, or not to be imported, by clicking the symbol to the left of the column name. You can click through the element, attribute, and ignore options. In the screenshot above, the city field, for example, has been set to be imported as an element while the street field has been set to be imported as an attribute.
Information about the conversion of database datatypes to XML Schema datatypes is listed in the Appendices.
© 2019 Altova GmbH