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
  • 8,665
  • 18
  • 86
  • 141

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,039
  • 1
  • 6
  • 26
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
  • 367,681
  • 72
  • 526
  • 573