declare namespace in XMLQuery
Hi,
I've a database table with XML documents inside an XMLType column. All the elements of these documents are defined in a specific namespace. To query these documents, I execute a "FLOWR" XQuery expression with the XMLQuery() function.
In order to be able to use the namespace prefix in my XQuery expression, I have add a "declare namespace" statement in the prolog of the XQuery expression. Thus my query looks like this :
SELECT ... XMLQuery(
'declare namespace c="myNamespace";
for $x in /c:myElement
...
However, when I execute the above query, I get an error because of the ";". Moreover, if I remove this character, I get another syntax error...
Does someone know how we can declare namespaces in queries like above ??
For information, I use Oracle 10g release 2 and I execute my queries in the Orace SQL*Plus tool.
Thank you for your help !
MD