Oracle XMLDB Pragma – Cheat sheet

Hereby a listing of XQuery, XPath pragma’s used in the Oracle (XMLDB) environment.

The list is currently not ordered, and/or order by topic; this so I will be able to add pragma’s more easily over time. Most of this stuff is documented but…not easy to find, so therefore this short list. This first attempt was created to make live a bit easier, to find the documentation or examples, but in all, far from complete…

XQuery

XQuery PragmaDescriptionExample
#ora:child-element-name#To specify the name of the inserted child elementOracle Documentation
#ora:defaultTable#Specify the default table used to store repository data.See “Using Oracle XQuery Pragma ora:defaultTable”
#ora:invalid_path empty#Treat an invalid XPath expression as if its targeted nodes do not exist.Oracle Documentation
#ora:view_on_null empty#XQuery function fn:collection returns an empty XML element for each NULL column.Oracle Documentation
#ora:view_on_null null#XQuery function fn:collection returns no element for a NULL column.Oracle Documentation
#ora:no_xmlquery_rewrite#Do not optimize XQuery procedure calls in the XQuery expression that follows the pragma. The scope of the pragma is only the XQuery expression that follows it (not an entire SQL statement).Oracle Documentation
#ora:xmlquery_rewrite#Try to optimize the XQuery expression that follows the pragma. That is, if possible, do not evaluate it functionally.Oracle Documentation
#ora:xq_proc#Do not optimize XQuery procedure calls in the XQuery expression that follows the pragma; use functional evaluation instead.Oracle Documentation
#ora:xq_qry #Try to optimize the XQuery expression that follows the pragma. That is, if possible, do not evaluate it functionally.Oracle Documentation

XML Text

XML Text Index PragmaDescriptionExample
#ora:no_schema#Avoid error ORA-18177 – If you use ora:no_schema for XQuery Full Text (Index), the XML data is implicitly cast to non-XML Schema-based data. In other words, Oracle support of XQuery Full Text treats all XML data as if it were not based on an XML Schema.Oracle Documentation
#ora:use_xmltext_idx#To be able to force the use of an existing XML Full Text IndexOracle Documentation

(To be)-De-Supported-List

Just as a reminder before you start to comment…

Normally practically “De-supported” means, that it probably still works and will work in the future (for a limited period). It is Oracle’s first signal to their customers that due to, for instance following W3C XML standards, it will be deprecating propriety created XML solutions. Probably you will be still save, the next five years to come, but if you have the chance, start implementing the new advised methods and solutions…

PragmaAlternativeReference
ora:instanceof()[. instance of element()]Oracle Whitepaper
ora:instanceof-only()xsi:typeOracle Whitepaper
ora:upper()fn:upper-case()Oracle Whitepaper
ora:lower()fn:lower-case()Oracle Whitepaper
ora:to_number()xs:decimal()Oracle Whitepaper
ora:to_date()xs:date()Oracle Whitepaper
ora:viewfn:collection/fn:docOracle Documentation
ora:matchesfn:matchesOracle Documentation
ora:replacefn:replaceOracle Documentation
ora:contains/containsXQuery Full TextOracle Documentation

 

HTH…