On Wed, 4 Feb 2004, Rick Measham wrote:

I'd love to see an XML parser embedded into SQL so that I can have:
CREATE TABLE aTable (id serial, data XML);


On 5 Feb 2004, at 05:21 pm, Chris Devers replied:
Does this help?

snip


Is this along the lines of what you were hoping for?

Thanks Christ, but not really at all. What I want is the ability to use XML as a data type so that I can have a field full of XML that is searchable. The output would be the'zactly the same as current output. The input would be XML as a string:


> INSERT INTO data (id, user, data) VALUES (1, 'rick','<user><name>Rick</name><surname>Measham</surname></user>');
> INSERT INTO data (id, user, data) VALUES (2, 'rick02','<user><name>Rick</name><surname>Smith</surname></user>');


# And then I could retrieve it:

> SELECT * FROM data WHERE data:user:name='Rick'

id |  user  |                          data
-----------------------------------------------------------------------
 1 | rick   | <user><name>Rick</name><surname>Measham</surname></user>
 2 | rick02 | <user><name>Rick</name><surname>Smith</surname></user>
(2 rows returned)


Cheers! Rick Measham Senior Designer and Developer

Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf



Reply via email to