Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi How is a xquery using in postges?
where condition from xml datatype.
XML
CREATE TABLE test (
    id int PRIMARY KEY,
    xmltext xml
);

INSERT INTO test VALUES (1, '<doc num="C1">
<line num="L1"><a>1</a><b>2</b><c>3</c></line>
</doc>');

INSERT INTO test VALUES (2, '<doc num="C2">
<line num="L2"><a>111</a><b>222</b><c>333</c></line>
</doc>');
Posted
Updated 29-Dec-10 2:43am
v2
Comments
Henry Minute 29-Dec-10 11:05am    
"How is a xquery using in postges?" To do what?

What is your question?

1 solution

Hi

how is use Xml query ?

ex: SELECT MyXmlField.query('data(/root/product[@id="304"]/name)') FROM MyTable
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900