Archive

Archive for November, 2011

Internal handling of XQuery functions

November 29, 2011 2 comments

… or more precisely user-defined recursive XQuery functions.
I recently stumble upon this while checking the explain plan of a query :
Read more…

Categories: Miscellaneous, XQuery Tags:

How To : Sort delimited values in a string using XQuery

November 28, 2011 2 comments

This follows a thread on OTN about a month ago. The question was : how to sort a string in ascending order?
I suggested an XQuery approach that turned out to be a lot more efficient than the traditional TABLE(SUBQUERY-FETCH) pattern.
Read more…

Categories: HowTo, XQuery Tags: , ,

How To : Generate a recursive XML structure

November 24, 2011 Leave a comment

Here are three techniques to generate a recursive XML structure, e.g. :

<employee id="100" name="King">
  <employee id="101" name="Kochhar">
    <employee id="108" name="Greenberg">
      <employee id="109" name="Faviet"/>
      <employee id="110" name="Chen"/>
      <employee id="111" name="Sciarra"/>
      <employee id="112" name="Urman"/>
      <employee id="113" name="Popp"/>
    </employee>
    <employee id="200" name="Whalen"/>
    <employee id="203" name="Mavris"/>
    <employee id="204" name="Baer"/>
    <employee id="205" name="Higgins">
      <employee id="206" name="Gietz"/>
    </employee>
  </employee>

  ...

  <employee id="201" name="Hartstein">
    <employee id="202" name="Fay"/>
  </employee>
</employee>

Read more…

Categories: HowTo, XQuery, XSLT Tags: , ,

How To : Write XML to file with encoding specification

November 23, 2011 2 comments

DBMS_XSLPROCESSOR.clob2file procedure provides a very easy way to write a CLOB to a file.
I use it extensively with XML content generated from the database, but each time I have to manually add the XML prolog with the proper encoding specification reflecting the actual character set :

Read more…

Oracle XML DB : a practical example

November 23, 2011 5 comments

It took time but here it is, my first blog entry : a practical example demonstrating some key features of Oracle XML DB.
For this article, I’ll be using the Forms XML schema and show how to do some interesting things with conformant documents.

Read more…