Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

declare namespace in XMLQuery

478379Dec 22 2005
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 19 2006
Added on Dec 22 2005
0 comments
1,569 views