xml spy
Previous  Top  Next
Import Database data...

ic_conv_imp_db
This command lets you import database data from many sources.

You can select:
·an existing database: such as Microsoft Access (i.e. Jet Engine), SQL Server, Oracle, or any other ODBC or ADO-conformant database).  

imp_db_data

Source database
Once you have selected your data source, you can choose the database table to be imported from a list. If you need help in entering an ADO connection string, click the Build button, which opens the ADO Data Link properties dialog box.
To define the ODBC connection string, please see: Setting up the ADO or ODBC connection string using the Data Source Administrator.

Selection statement
Click on the "Choose database table" button, to select the database, or enter an arbitrary SELECT statement to create the record-set you intend to import. You can also enter a ADO shape string (selection statement) if you selected the ADO connection string radio button.

Having configured the data source, click the Preview button to verify that this is indeed the correct data that you wish to import. For security reasons, the OK button is only enabled after you have previewed the data.

Please note:  
If you used the menu option Convert | XML Import based on DB Schema prior to opening this dialog box, the automatically generated select statement (used in that process) will appear in Select statement text box. You can now reuse or edit the select statement and start a new import.  

Format of Number, Date and Time values
XML Spy lets you choose different representations for date and number formats - depending on whether you intend to use the resultant XML file in conjunction with the new unified datatypes proposed by the most recent XML Schema draft, or if you want to keep those formats corresponding to the locale in use in your country.

Import data as Elements/Attributes
These options let you specify how you want the parent and child elements to be imported: as elements or attributes. The preview is updated when you select one of these options.

Exclude Primary/Foreign keys
This option enables you to exclude the primary or foreign keys for all the tables you are importing.

Please note:
This option only affects the keys of database tables that have been exported using the XML Spy Conversion option "Export to Text files / Database...", with the "Create Primary/Foreign keys" being active. The key names are PrimaryKey and ForeignKey respectively.

Create empty elements from empty fields
This option lets you create empty elements for all the empty fields that exist in the tables you import.

Attribute, Element, or no columns
XML Spy lets you choose if you want to import a parent column as an attribute, element, or if you'd rather skip the column entirely.

Click on the icons to the left of the column titles, to toggle between these three options. In the example above,
   ContactID - is imported as an attribute
   Contacts.Company - is not imported
   FirstName, LastName - are imported as elements.

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.  


Previous  Top  Next

© 2002 Altova