V9.1 Insert Trigger to extract attribute from the XML document beinginserted.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rajesh Kumar Joshi

    V9.1 Insert Trigger to extract attribute from the XML document beinginserted.

    I have a test table
    //---------------------------
    name varchar(32)
    version varchar(16)
    profile XML
    //---------------------------
    The content of the XML file is
    <sampleprofil e name="joe" version="123">
    <phone>12345678 9</phone>
    ...
    ...
    </sampleprofile>
    //------------------------------------

    While inserting a new row , I want to populate the 'name' and
    'version' columns from the content of the XML data.
    Is it possible to write a Trigger to manupulate the XML data before
    its inserted? To make thing more interesting the table has a unique
    index on name+version.

  • Serge Rielau

    #2
    Re: V9.1 Insert Trigger to extract attribute from the XML documentbeing inserted.

    I don't think manipulating XML data is supported in DB2 9.1.
    Most of that appeared in DB2 9.5:




    --
    Serge Rielau
    DB2 Solutions Development
    IBM Toronto Lab

    Comment

    • Rajesh Kumar Joshi

      #3
      Re: V9.1 Insert Trigger to extract attribute from the XML documentbeing inserted.

      On Apr 16, 8:28 am, Serge Rielau <srie...@ca.ibm .comwrote:
      I don't think manipulating XML data is supported in DB2 9.1.
      Most of that appeared in DB2 9.5:http://publib.boulder.ibm.com/infoce...pic/com.ibm.db...
      >
      --
      Serge Rielau
      DB2 Solutions Development
      IBM Toronto Lab
      We are experimenting with pureXML features with DB2 v9.1.
      I am able to use XMLTABLE, XMLEXISTS , xquery with it and they all
      work fine in 'Select' statements.
      I was wondering if I can use xpath or xquery in the TRIGGERs ? Is
      this possible in DB2V9.1+pureXML or even DB2 V9.5 ?
      Regards
      Rajesh

      Comment

      Working...