Querying existing Data in a relational Database via Tamino

Hello,

we are using Tamino 4.1 and have defined a schema of an existing relational database (MS Access) to Tamino.

We can insert data via Tamino into the Access db and query it.

But if we want to query the data, that is not inserted via Tamino, we have the following problem:

A query by which we want to retrieve a whole table works fine whereas a query which select something in a table does not work.

For test purposes we generated a relational database (MS Access) with four tables:

buecher {isbn, titel, verlag, seitenzahl}
autoren {autor_nr, autor}
auflagen {isbn, auflage, bemerkung}
buch_autor {isbn, autor_nr}

We recieve the following error message, if we try to select something within a table (e.g. ‘//Buecher[ISBN=“1”]’):

xql:query//Buecher[ISBN=“1”]</xql:query>
- <ino:message ino:returnvalue=“8505”>
<ino:messagetext ino:code=“INOXME8505”>ODBC error occurred</ino:messagetext>
ino:messagelineState: 22018Native Error: 39 [Microsoft][ODBC Microsoft Access Driver]Invalid character value for cast specification (null)</ino:messageline>
</ino:message>

In the Tamino schema we defined a root element (gesamtbestand). We put the definitions of all tables under this element. We attach our schema definition to this posting.

Any help would be appreciated.

Thanks in advance and

best regards
NSDB (Thorsten, Stefan, Mirco)
REL_V3.TSD (9.53 KB)

Hi NSDB,

using the given schema I could reproduce the problem.
There is no simple workaround: you have to call your
local Software AG support and request a hotfix.

Some details:
The problem occurs because the query //Buecher[ISBN=“1”]
requires postprocessing (which can be seen when using
ino:explain).
This has two reasons:
- ISBN has datatype xs:integer, but in the query it is
compared to the string “1”. This can easily be fixed
by rewriting the filter as [ISBN=1]
- “Buecher” is multiple (it has maxOccurs = “unbounded”,
and it appears under a choice with maxOccurs = “unbounded”)
and it is followed by a filter.
Post processing can only be avoided if the schema is
modified such that only one “Buecher” element is allowed,
which is probably not what you want.


A general remark:
why do you put all your data into one XML document?
Of course I do not know your application, but another
approach would be to create one doctype for each table.
Then your query would be /Buecher[ISBN=1], which would work.



Best regards,
Manfred Michels
R&D Tamino Server