Saturday, September 11, 2010

A MySQL Tidbit: Dynamic Export To_XML Stored Procedure

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL

Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of. So the topics of parsing and manipulating XML, importing and exporting XML files, etcetera using SQL are pretty commonplace here at Experts Exchange.

Consequently, in two of my previous MySQL tidbits, I covered some real questions from EE's Q&A forum:

While writing those articles and participating in the mentioned questions, I was urged by a fellow database expert to write some tips on the importing and exporting of XML, specifically in SQL using MySQL database server. As a result, this particular installment of my SQL tidbits will cover: (1) dynamically constructing XML elements from a given table structure; and (2) exporting a result set to XML file.

The end product will be a technique you can customize and test for your own XML needs. This technique will be shown in a stored procedure. For beginning MySQL readers, I will be providing some background tips -- explanations on some of the inner workings of the SQL code in the procedure...

Read more of "A MySQL Tidbit: Dynamic Export To_XML Stored Procedure" on


Saturday, August 07, 2010

A SQL Tidbit: Conditional Aggregates

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time!

By the end of my Experts-Exchange Article, A SQL Tidbit: Conditional Aggregates, it is my intention to bring the meaning and value of the above quote to those who chose to read this whether as a beginning SQL programmer or an intermediate one inexperienced with this little tidbit of SQL syntax: conditional aggregation.

Conditional aggregation is simply the use of aggregates under one or more conditions, thus, potentially altering your results of functions like SUM(), COUNT(), etcetera in a particular column while allowing you to analyze your record set as a whole...