How do you create an XML document using SQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DaveS

    How do you create an XML document using SQL

    Hello,

    I'm using Oracle 9.2 and would like to automatically save a copy of
    each deleted record in XML format to another database table. There
    would be one XML record for each deleted record. I'd like to store
    the XML record in a CLOB. I've created a table and added a trigger to
    capture the delete event but I'm not sure how to create the XML
    document. Each deleted record is comprised of a single row from a
    parent table and multiple rows from a child table. Heres the catch;
    I don't want the solution to require me to specify each individual
    column in each table. I'd like to use the wildcard(*) operator to
    select the columns. The Oracle documentation I've read says to use
    objects to create complex XML but you can't use the wildcard operator
    to specify the columns. I've looked at using dbms_xmlgen which
    supports the wildcard operator but I can't create a well formed XML
    document. Any ideas or examples would be greatly appreciated.

    Thanks
Working...