0

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

Basically I'd like to have the contents of an entire record in 1 string...

Dylan
  • 9,129
  • 20
  • 96
  • 153

2 Answers2

1

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

Community
  • 1
  • 1
Demitrius Nelon
  • 1,210
  • 1
  • 10
  • 29
0

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:

Sarfraz
  • 377,238
  • 77
  • 533
  • 578