Hi,
I’m trying to update the data in some SQL tables via XNode. Replacing documents through X-Query works fine, but I get “Internal Database Error” when I try to use XQuery for updating a record.
I use the X-Node mapping example from the documentation.
By the way: The tamino schema given in the documentation has two mistakes that must be fixed before it can be defined in tamino: The spelling for tsd:primarykeyNode that tamino accepts appears to be with a minor k, not a major one. Secondly, maxOccurs for the element patient/address/phone should be 1, not *. Besides, I had to take out white space from SQL column names, otherwise SQL Server reports Syntax errors, but maybe that is specific to MSSQL?
Ok, so with that schema and a SQL table in MSSQL Server I manage to do queries in XQuery and X-Query, but updates only in X-Query. The XQuery hereafter produces an internal database error. The update in the SQL database is nevertheless done, but apparently the transaction is not committed cleanly, because I can only access the SQL Table after closing down my XQuery Tool.
update replace input()/patient/address/street[. = "Bath Road " ]
with ABDCE street
Does anyone have a example that works for XQuery updates with X-Node?
Thanks a lot,
Robert