Wednesday, 25 July 2018

How to store and retrieve XML data into MySQL

MySQL doesn’t support XML data types like Microsoft SQL Server or PostgreSQL.
Many times it is required to store multiple nodes of data into a single column, in the form of XML.
In the MySQL, You have to store XML in CLOB (Character Large Object) data type.
MySQL provides different types of XML function so using those functions, we can parse the XML data very easily.
Below is a full demonstration on storing and retrieval of XML data:
First store XML data like any other string:
Second, Parsing this data using below stored procedure:
Call this stored procedure and check the result:


MySQL XML

0 comments:

Post a Comment