Next in thread → Next in month →

Re: [xml-dev] database primary keys in XML Schema

From
Tor Helland <>
To
Date
2004-02-13T15:21:45Z
ID
<01f901c3f245$2fd02060$0301a8c0@rhuidean>
Thread
Re: [xml-dev] database primary keys in XML Schema
> But what if I want to add some cities at a later point?
> My idea was to design my schema in a way that it allows the city element
to
> be declared as document root. Doing so, I can insert only cities (using
the
> same XML Schema as for inserting all three parts together).
> But how can I tell the parser/RDBMS which country/state the cities to be
> inserted belong to?
> One idea I had was to add a attribute to the city element in order to
> specifiy the RDBMS primary key for country. But the XML document creater
must know
> the RDBMS key in advance then ...

IMHO this is not an xml problem. You need to identify the city's "owner" by
something other than its primary key. I guess you have a unique index in the
db on the state table, specifying uniqueness on the combination [state name
or abbreviation + country key].

Or you could look up the state in the db, get its key, and then setup the
xml document.

-tor
Next in thread → Next in month →