Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2013
    Posts
    8

    Unanswered: XML Exist problem

    I want to create a queary that uses XML exist where it would display a specific row depending of the value from the XML i want to set.

    I will be basing on this sample XML:

    Code:
    <Sample>
            <Content>Keyboard</Content>
    </Sample>
    I want to display all rows that has the word Keyboard within the <Content> tag but my XML exist query is not working, here it is:

    Code:
    XMLEXISTS('$SAMPLETBL/Sample/Content/text() = Keyboard')
    Do i need to change something with my queary? This is my first time doing a query like this please bear with me. Any help or suggestion will be gladly accepted, thanks in advance.
    Last edited by intes2013; 10-16-13 at 07:21.

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    XMLEXISTS('$root/Sample[Content='Keyboard"]' passing SAMPLETBL as "root')

    SAMPLETBL should be the name of your XML column
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  3. #3
    Join Date
    Oct 2013
    Posts
    8
    Thanks alot it works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •