| From: | Jignesh Ramavat <ramavat(dot)jignesh(at)gmail(dot)com> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | help for xml create in postgresql |
| Date: | 2011-07-11 07:44:03 |
| Message-ID: | CAG6nKmK7cmkQ1w9qS66sV5HPf67ewbUP=p8QzimNqkkHbVnF0w@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
i need to create xml by using xml function in postgresql.
i can create following xml by using this query
Query:
SELECT XMLELEMENT(name chapter,
XMLATTRIBUTES(
'1' AS number,
CURRENT_DATE as current_date),
XMLELEMENT(name document, XMLATTRIBUTES((select typeaccountcode from
typeaccount limit 1) AS doc_name)));
Result:
<chapter number="1" current_date="2011-07-11">
<document doc_name="Billing"/>
</chapter>
*BUT IF i want result in following format then?*
<chapter number="1" current_date="2011-07-11">
<document doc_name="Billing"/>
<document doc_name="EManager"/>
<document doc_name="Immunization"/>
<document doc_name="NueMD"/>
<document doc_name="NueMDSched"/>
<document doc_name="SuperAccount"/>
<document doc_name="UnivScheduler"/>
</chapter>
--
Thanks & Regards,
Jignesh Ramavat
Software Engineer
Yosa Technology Solutions Pvt. Ltd
09924407751
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Johnston | 2011-07-11 13:10:57 | Re: [HACKERS] Creating temp tables inside read only transactions |
| Previous Message | Adarsh Sharma | 2011-07-11 05:14:59 | Schema for Website Comments |