2 Replies Latest reply: Apr 8, 2008 1:54 PM by 450482 RSS

    XMLType.extract vs extractValue

    419751
      I was told that the syntax

      extractvalue(value(t), '/ROW/LASTNAME/text()') LASTNAME

      should be used over

      xmltype.extract(value(t), '/ROW/LASTNAME/text()').getStringVal() LASTNAME

      Is this just a preferred syntax, or is it a standard?

      Thanks!

      Katia
        • 1. Re: XMLType.extract vs extractValue
          517664
          extractvalue(value(t), '/ROW/LASTNAME/text()') LASTNAME

          could be

          extractvalue(value(t), '/ROW/LASTNAME') LASTNAME

          here no need to mention text() as extractvalue brings in value of the last node in the treee

          and

          xmltype.extract(value(t), '/ROW/LASTNAME/text()').getStringVal() LASTNAME

          could be

          xmltype.extract(value(t), '/ROW/LASTNAME/text()') LASTNAME

          extract() without text() will return with tag values while extractvalue() will return the value of the tag at the last child node of an hierarchy

          Regards
          JP
          • 2. Re: XMLType.extract vs extractValue
            450482
            Hi
            Which version supports extractvalue? I am using 10.2.0.3 and it gives me the error: extractvalue - invalid identifier.