Not logged in : Login
(Sponging disallowed)

About: http://demo.openlinksw.com/tutorial/xmlsql/ms_a_5/ms_a_5.vsp     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : foaf:Document, within Data Space : linkeddata.uriburner.com:28898 associated with source document(s)

AttributesValues
type
Title
content
  • Preliminaries Rows returned from a database query can be limited on the basis of some limiting value. The sql:limit-field is used to identify the database column that contains limiting values and sql:limit-value annotations is used to specify a specific limiting value to be used to filter the data returned. The sql:limit-value annotation is optional. If sql:limit-value is not specified, a NULL value is assumed. Example. This is the mapping schema in which the 'product_Chai' schema attribute maps to the 'ProductID' column in the 'Demo.demo.Products' relation. The values that are returned for this attribute are limited to only 'ProductName' having the 'Chai' value by specifying the sql:limit-field and sql:limit-value annotations. Similarly, the 'product_Chang' schema attribute returns only the 'ProductID' limited to 'ProductName' having the 'Chang' value. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema"> <xsd:annotation> <xsd:appinfo> <sql:relationship name="CategoryProduct" parent="Demo.demo.Categories" parent-key="CategoryID" child="Demo.demo.Products" child-key="CategoryID" /> </xsd:appinfo> </xsd:annotation> <xsd:element name="category" sql:relation="Demo.demo.Categories" type="CategoryType" /> <xsd:complexType name="CategoryType" > <xsd:sequence> <xsd:element name="product_Chai" type="xsd:string" sql:relation="Demo.demo.Products" sql:field="ProductID" sql:limit-field="ProductName" sql:limit-value="Chai" sql:relationship="CategoryProduct" > </xsd:element> <xsd:element name="product_Chang" type="xsd:string" sql:relation="Demo.demo.Products" sql:field="ProductID" sql:limit-field="ProductName" sql:limit-value="Chang" sql:relationship="CategoryProduct" > </xsd:element> </xsd:sequence> <xsd:attribute name="CategoryID" type="xsd:integer" /> <xsd:attribute name="description" sql:field="Description" type="xsd:string" /> </xsd:complexType> </xsd:schema> Let the schema is written to the file 'Cat_Product.xsd', then after loading this file by xml_load_mapping_schema_decl function, the first example will produce a result for the XPath query: XPATH [__view 'Cat_Product'] /*[@CategoryID=1] the second example will produce a result for the XQuery query: select xquery_eval('<doc>{for $r in xmlview("Cat_Product")/*[@CategoryID=1] return $r}</doc>', xtree_doc('<q/>'))
has container
description
  • Filtering Values by Using sql:limit-field and sql:limit-value
dcterms:created_at
  • Fri, 27 Dec 2019 14:12:54 GMT
content:encoded
  • Preliminaries Rows returned from a database query can be limited on the basis of some limiting value. The sql:limit-field is used to identify the database column that contains limiting values and sql:limit-value annotations is used to specify a specific limiting value to be used to filter the data returned. The sql:limit-value annotation is optional. If sql:limit-value is not specified, a NULL value is assumed. Example. This is the mapping schema in which the &#39;product_Chai&#39; schema attribute maps to the &#39;ProductID&#39; column in the &#39;Demo.demo.Products&#39; relation. The values that are returned for this attribute are limited to only &#39;ProductName&#39; having the &#39;Chai&#39; value by specifying the sql:limit-field and sql:limit-value annotations. Similarly, the &#39;product_Chang&#39; schema attribute returns only the &#39;ProductID&#39; limited to &#39;ProductName&#39; having the &#39;Chang&#39; value. &lt;xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:sql=&quot;urn:schemas-microsoft-com:mapping-schema&quot;&gt; &lt;xsd:annotation&gt; &lt;xsd:appinfo&gt; &lt;sql:relationship name=&quot;CategoryProduct&quot; parent=&quot;Demo.demo.Categories&quot; parent-key=&quot;CategoryID&quot; child=&quot;Demo.demo.Products&quot; child-key=&quot;CategoryID&quot; /&gt; &lt;/xsd:appinfo&gt; &lt;/xsd:annotation&gt; &lt;xsd:element name=&quot;category&quot; sql:relation=&quot;Demo.demo.Categories&quot; type=&quot;CategoryType&quot; /&gt; &lt;xsd:complexType name=&quot;CategoryType&quot; &gt; &lt;xsd:sequence&gt; &lt;xsd:element name=&quot;product_Chai&quot; type=&quot;xsd:string&quot; sql:relation=&quot;Demo.demo.Products&quot; sql:field=&quot;ProductID&quot; sql:limit-field=&quot;ProductName&quot; sql:limit-value=&quot;Chai&quot; sql:relationship=&quot;CategoryProduct&quot; &gt; &lt;/xsd:element&gt; &lt;xsd:element name=&quot;product_Chang&quot; type=&quot;xsd:string&quot; sql:relation=&quot;Demo.demo.Products&quot; sql:field=&quot;ProductID&quot; sql:limit-field=&quot;ProductName&quot; sql:limit-value=&quot;Chang&quot; sql:relationship=&quot;CategoryProduct&quot; &gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name=&quot;CategoryID&quot; type=&quot;xsd:integer&quot; /&gt; &lt;xsd:attribute name=&quot;description&quot; sql:field=&quot;Description&quot; type=&quot;xsd:string&quot; /&gt; &lt;/xsd:complexType&gt; &lt;/xsd:schema&gt; Let the schema is written to the file &#39;Cat_Product.xsd&#39;, then after loading this file by xml_load_mapping_schema_decl function, the first example will produce a result for the XPath query: XPATH [__view &#39;Cat_Product&#39;] /*[@CategoryID=1] the second example will produce a result for the XQuery query: select xquery_eval(&#39;&lt;doc&gt;{for $r in xmlview(&quot;Cat_Product&quot;)/*[@CategoryID=1] return $r}&lt;/doc&gt;&#39;, xtree_doc(&#39;&lt;q/&gt;&#39;))
is container of of
Faceted Search & Find service v1.17_git144 as of Jul 26 2024


Alternative Linked Data Documents: iSPARQL | ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3331 as of Aug 25 2024, on Linux (x86_64-ubuntu_noble-linux-glibc2.38-64), Single-Server Edition (378 GB total memory, 37 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software