OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] XML spy- exporting xml into multiple tables

[ Lists Home | Date Index | Thread Index ]

[Neile Bermudes]>
> My question is, how to constuct your xml file so that when you export it
to
> MS SQL using XML Spy, the data will go to it's specified table.
>
> For example, say I've got a database with two tables: Contacts and
> Organisations. Contacts and Organisations have a relationship set up
between
> them so that whenever you add a Contact, you have to specify what
> Organisation they belong to. Now, if I want to update a database with an
XML
> file that contains, say, the first name and last name of a contact (which
> would need to go into the Contact table) and the organisation they belong
to
> (which would need to correspond to an Organisation table that already
exists
> and already has a list of available organisations).
>
> I'm using an attribute-based xml file, e.g.
>
> <root>
> <Contact FirstName="Joe" LastName="Bloggs"/>
>
> Where or how would I include Organisation???
>

Spy would put the row above into the "Contact" able.  The best way to work
this out for more complicated table structures is to import a file from your
database into Spy, then have Spy export that as is to a new Access database.
Then import from that new database back into Spy and between the import
wizard and the imported xml, you should see how it handled the several
tables and foreign keys.  You can do this without actually having Access on
your system, since your Windows computer will have the drivers necessary
(unless it is awfully old).

For example, Spy imports a single query in a series of elements named "Row".
When you export that xml file to a new database, Spy creates a table called
"Row".

I do not know what Spy does WRT unchanged data vs updated data.

Cheers,

Tom P






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS