You are correct on all counts.
1) This functionality is not in version 1.0. (We plan to add it in
2) It is a general problem, not limited to just Oracle.
3) XML-DBMS needs to update the row object with the newly-generated key.
This is expensive, so it won't be done unless needed -- the 2.0 map has
an option that says when to do this.
4) I don't know if anybody has implemented this yet. If you want to do
it yourself, you need to:
a) Create a select statement with WHERE parameters for all columns in
the row. This should include the ROWID (I think that's what Oracle calls
it) column as the only column in the select list.
b) Set the parameters to use the current values in Row.
c) Execute the select statement, retrieve the first row, and set the
rowid in the row.
I can think of the following problems:
a) The insert statement generated for the table will probably be
incorrect, since it will include a parameter for the ROWID column.
b) If you always let the database generate the keys, then using
Generate="No" in the map will be OK. If the data sometimes contains keys
and you sometimes generate keys, you'll probably want to add a flag in
the map language like Generate="Database".
c) If the select statement returns more than one row, you'll probably
need to throw an error, since you won't know which row was just
There are probably others as well, but I don't know what they are.
"Juan José Garcia - Nuño Poveda" wrote:
> Hi everybody,
> this is my first e-mail message. First of all
> congratulations to Ronald, all his colaborators and
> all of you for the making of this wonderfull free
> Everything works great but I have a problem.
> I´m designing a XML based messaging system betwen two
> applications. My DBMS is Oracle 8i.
> Ok, so the problem is:
> I´m trying to use Oracle autogenerated Primary Keys
> (Sequences/Triggers) as reference keys in the
> parent-child relationships for the database data
> generated by xml-dbms.
> With xml-dbms generated Primary Key values all works
> great. But with oracle generated keys it doesnt work.
> I´ve been taking a fast view to the code and it seems
> that the problem is that DOMtoDBMS does not update the
> Row object contents with the database content after
> inserting the parent record.
> Whithout this update it´s not posible to xml-dbms to
> know if any automatism of the DBMS has updated the
> value of the primary key of the parent object when
> inserting the child object.
> I´m working with Oracle but I guess the problem exists
> with any DBMS whith an autonumeric Primary Key
> - I´m doing things right but xml-dbms does not support
> what I´m trying to do or there is a way to do it?
> - Can it (if needed) be fixied with an easy
> - Has anybody made that modification?
> I know thar reaccesing every record ( at least every
> foreign key referenced record) after every insertion
> can be time consuming (especialy over weak or
> saturated communication lines) so a final
> implementation of this functionality sould be
> optionaly configurable and shold only query the
> inserted row when it were foreign key referenced.
> Thanks in advance.
> Juanjo Garcia
> Software Architect.
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> To post a message, send it to: firstname.lastname@example.org
> To unsubscribe, send a blank message to: email@example.com
> Or join the newsgroup at: news://news.barkto.com/homeless.xml.xml-dbms
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Programming, Writing, and Training
XML, Databases, and Schemas