开发者

Equivalent SP in MySQL for sp_xml_preparedocument of SQL Server

I have two 开发者_开发技巧queries -

  1. What would be the equivalent sp\function name in MySQL for sp_xml_preparedocument of SQL Server?
  2. What would be the equivalent sp\function name in MySQL for OPENXML of SQL Server?


In sp_xml_preparedocument \ openXML, I can directly put my XML and can use as a table. But, in case of ExtractValue and UpdateXML, I have to insert each xml row in seperate row of the table and then select. Concedering the following example - if I want to use '<books> <book> <title>A guide to the SQL standard</title> <author> <initial>CJ</initial> <surname>Date</surname> </author> </book> <book> <title>SQL:1999</title> <author> <initial>J</initial> <surname>Melton</surname> </author> </book> </books>' This xml I can use directly in SQL Sql Server. But in case of MySQL, I have to insert two row into the table then use ExtractValue function.


To start with, SQL Server itself has moved off sp_xml_preparedocument and openXML - these are procedural functions that use handles - very unwieldy.

In MySQL, you can use the XML functions ExtractValue and UpdateXML http://dev.mysql.com/doc/refman/5.5/en/xml-functions.html

And here's a very short intro on how to use them http://dev.mysql.com/tech-resources/articles/mysql-5.1-xml.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜