![]() |
Previous Top Next |
Importing hierarchical data - Data shaping (ADO)
|
· | The MSDataShape provider
|
· | The special Data shape language, which is a subset of SQL
|
|
1. | Select the menu option Convert | Import Database data...
|
![]() |
2. | Click the ADO connection string radio button, and then the Build button.
|
![]() |
3. | Double click the MSDataShape entry in the list box.
|
This automatically switches you to the Connection tab.
|
![]() |
4. | Enter "shape" in the Data Source field.
|
5. | Click on the "Test Connection" button (at the bottom of the dialog box), if you want to make sure you can connect to the database - and then click OK to close the Test connection message box.
|
6. | Click OK to close the Data Link Properties dialog box.
|
![]() |
The ADO connection string now appears in the text box.
|
7. | Open the shape.txt file supplied with the tutorial; copy the first Shape select statement, and paste it into the Selection statement text box.
|
![]() |
8. | Click the "Preview" button to see a portion of the database data.
|
![]() |
· | Only the top level (parent) of the database data, defined by the shape command, is visible in the preview window.
|
![]() | Define and import this field as an Element.
|
![]() | Define and import this field as an Attribute.
|
![]() | Skip, do not import this field.
|
Please note:
|
You can only directly influence the parent elements that you see here. You cannot change or choose to skip any elements below these ones (i.e. child elements).
|
· | Select either the Elements by default or Attributes by default option, to define how you want to import the child elements. The preview is updated when you select one of these options.
|
· | Activate or deactivate the "Exclude Primary/Foreign keys" check box, to define if you want to import the data with or without primary or foreign keys.
|
· | Activate or deactivate the "Create empty elements from empty fields" check box, to define if you want empty elements to be created for those fields that do not contain any data.
|
|
Please note:
|
The selections you make here initially apply to the parent items as well. Changing parent items directly, takes precedence over these settings, but only applies to the parent elements and not to any child elements.
|
Clicking the Preview button, resets any changes made to the parent elements in the Preview view.
|
|
1. | Click the OK button of the Database import dialog box, when you have completed your definition of the data you want to import.
|
|
XML Spy creates an untitled XML file containing the Division and Person table data. The root element is called Import, and each Division element is a table row. Each Division element also contains the Person child elements, displayed in table form.
|
![]() |
Click the Row element and press F9 (or click the Display as Table icon ![]() |
![]() |
|