Is there any chance to get output directly from XML in my MySQL query? Some refer to SQL-XML plugin, such as MSSQL, such as
, for example:
SELECT * Table where 1 XML gives Auto
text (or XML data type to be exact) in MSSQL, in which the table contains the XML markup structure generated according to the columns.
SQL-XML There is also an option to explicitly define output XML structure like this:
SELECT 1 AS tag, NULL as parent, emp_id AS [employee! 1! Emp_id], from the table for the cust_id as [xml explorer
), which generates an XML code as follows:
Customer! 2! Cust_id], Area AS [Customer! & Lt; Employee Emp_id = '12 9 '& gt; & Lt; Customer cust_id = '107' field = 'Eastern' / & gt; & Lt; / Staff & gt;
Do you have a clue how to achieve it in MySQL?
Thank you in advance for your reply.
From MySQL query to XML, there is a good place to start with various methods.
From the article:
Use strict; Use DBI; XML :: Generator :: Use DBI; XML :: Handler :: UARIR; My $ dbh = dbi- & gt; Connect ("DBI: MyScall: Test", "TestSyear", "Testpass", {Ricerra => 1, PrintArray =>);); My $ Out = XML :: Handler :: YAWriter- & gt; New (asFile => "-"); My $ gen = XML :: Generator :: DBi- & gt; New (handler = & gt; $ out, dbH = & gt; $ dbh); $ Gen- & gt; Execute ("Selection Name, Animal by Category"); $ Dbh- & gt; Disconnect ();
Comments
Post a Comment