开发者

MySQL : XML from a resultset?

开发者 https://www.devze.com 2023-02-01 21:41 出处:网络
Is it possible to generate an XML (or csv) string from a resultset in MySQL ? Basically I\'d like to hav开发者_运维技巧e the contents of an entire record in 1 string...Yes, here is the documentation

Is it possible to generate an XML (or csv) string from a resultset in MySQL ?

Basically I'd like to hav开发者_运维技巧e the contents of an entire record in 1 string...


Yes, here is the documentation for XML, and a reference to the CSV question on SO.


Just a quick example, you can use xml_tag like this:

select xml_tag('table',table_name,null,null)
from information_schema.tables
where table_schema = 'INFORMATION_SCHEMA'

Comprehensive Docs:

  • http://dev.mysql.com/tech-resources/articles/xml-in-mysql5.1-6.0.html
0

精彩评论

暂无评论...
验证码 换一张
取 消