USING XQUERY WITH THE XML DATA TYPE where

USING XQUERY WITH THE XML DATA TYPE where $b/@name = moe return ($b) ) AS persons FROM xml_tab XPath predicate SELECT the_id, xml_col.query( /people/person[@name= moe ] ) AS persons FROM xml_tab Note that for the columns in which moe did not occur, the result is an empty sequence rather than an empty string or a NULLvalue. the_id persons 1 2 3 4 You can also return literal content interspersed with query data by using the standard curly brace notation. The following query returns a series of results surrounded by XHTML list tags (

  • ). Note that this uses an element normal form version of the XML in the table, rather than the attribute normal form we ve been using thus far. CREATE TABLE xml_tab( the_id INTEGER PRIMARY KEY IDENTITY, xml_col XML) GO INSERT xml_tab VALUES( curly ) INSERT xml_tab VALUES( larry ) INSERT xml_tab VALUES( moe ) INSERT xml_tab VALUES( curly larry moe moe ) GO literal result element and constructor with curly braces SELECT xml_col.query(

    Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services

  • Bookmark the permalink.

    Comments are closed.