Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2010
    Posts
    31

    Unanswered: XML parsing (xmlexists)

    Hi, I am trying to use the following command with the table name 'transaction' mentioned in the xmlexists statement as hard coded.

    select distinct name
    from nav.xml_stage,
    xmltable('$c/dataChanges/table' passing XML_DATA as "c"
    COLUMNS name varchar(30) path '@name')
    where xmlexists ('$c/dataChanges/table[@name="transaction"]/row[@type="U"]' passing XML_DATA as "c")

    But I need to pass the table name value to this statment like

    select distinct name
    from nav.xml_stage,
    xmltable('$c/dataChanges/table' passing XML_DATA as "c"
    COLUMNS name varchar(30) path '@name')
    where xmlexists ('$c/dataChanges/table[@name='" || table_name || "']/row[@type="U"]' passing XML_DATA as "c")

    When I use the "' || table_name || "' as parameter value, it gives error message.

    Can someone please help me about how to pass the parameter value.

    Thanks

    Naveed

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    try


    where xmlexists ('$c/dataChanges/table[@name="$t"]/row[@type="U"]' passing XML_DATA as "c", table_name as "t")

  3. #3
    Join Date
    Jan 2010
    Posts
    31
    where xmlexists ('$c/dataChanges/table[@name="$t"]/row[@type="U"]' passing XML_DATA as "c", table_name as "t")

    Sorry, it did not work.

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

Posting Permissions

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