[xquery-talk] Extracting XML data from a Table in PosgreSQL

Alice Wei ajwei at indiana.edu
Thu Dec 27 20:48:23 PST 2007

Thanks to everybody's responses, I think that I will consider using 
other types of databases to implement my queries.


Alice Wei
MIS 2008
School of Library and Information Science
Indiana University Bloomington
ajwei at indiana.edu

Quoting Peter <pc.subscriptions at gmail.com>:

>> queries, but I don't know of one that does this - the DataDirect engine,
>> which has this general architecture, will allow you to use XQuery
>> against
>> data stored in relational form, but not (as far as I am aware) against
>> XML
>> stored in a relational database as text.
> Actually...it is possible using an extension function (ddtek:parse).
> The doc has an example
> create table xmltab (key int primary key, xmlval varchar(2000))
> insert into xmltab values(1,'<a><b>1</b><b>11</b></a>')
> insert into xmltab values(2,'<a><b>2</b><b>22</b></a>')
> The following query returns the key value and b elements from
> the xmlval column for every b element that contains a value
> greater than 10:
> for $x in collection('xmltab')/xmltab
> let $y := ddtek:parse($x/xmlval)//b[xs:integer(.) > 10]
> return (data($x/key),$y)
> I am unfamiliar with the latest changes in terms of product architecture,
> but with the last version I knew some of the internals, this approach would
> only be practically feasible on 'smaller' XML fragments.

More information about the talk mailing list