MySQL management, tutorials, scripts, coding, programming and tips for database administrators
In the Importing XML Data into MySQL Tables Using a Stored Procedure article, Rob Gravelle outlined some ways to work around MySQL's restrictions on stored procedures to import XML data into your MySQL database tables. Today's article covers how to use a Prepared Statement, including error handling and validation, as well as handling additional XML formats.
In theory, it would seem that a stored procedure would be the perfect vehicle for importing XML data from a file, and yet, the LOAD XML INFILE statement cannot be run within a Stored Procedure. Fortunately, there is a way to get around this limitation.
Ever since Oracle became the owner of MySQL when it acquired Sun Microsystems in 2010, improvements to the software haven’t been as forthcoming as one might hope. There still doesn’t seem to be anything like groups in MySQL. According to Oracle, we can expect it to arrive for MySQL 7.0! Until then, this article presents a few software offerings that may help tide you over.
There are a lot of occasions for converting one data type to another in MySQL. All of these can be achieved using MySQL's native CONVERT() and CAST() functions. Read on to learn how to use both.
Over time, applying the same rounding algorithm to many numbers can lead to a condition known as rounding bias. Rob Gravelle presents some rounding implementations in MySQL that attempt to eliminate (or at least reduce) rounding bias.
Most of us have to take care of a database that we don't know like the back of our hand at some point or another. Should you have to look up a value it helps tremendously to have the capability to perform a database-wide sweep. Rob Gravelle suggests three ways of doing so.
Although MySQL does provide its own Round() function, for those times that it doesn't provide the results that you're looking for, you'll be happy to know that implementing your own rounding function is not all that difficult. Rob Gravelle presents a few to get you started.
One of the tenets of Third Normal Form (3NF) database normalization is that calculations should not be stored in a table. In MySQL, calculations are made easier by a number of built-in functions. In today's article, Rob Gravelle provides an overview of three of the more widely applicable ones.
The MySQL 5.6 memcached plugin for InnoDB uses a daemon that automatically stores and retrieves data from InnoDB tables, without the overhead of SQL. Rob Gravelle goes over some of its uses and benefits.
Robert Gravelle explores the use of cursors and their role in stored procedure programming.
A loop is a programming construct that executes a block of code repeatedly based on a condition. Cursors, on the other hand, are utilized to process each row returned by a SELECT statement. Read on to learn about various loop types supported by MySQL as well as an introduction to cursors.
Ease of use and speedy performance are just two of the many features that make MySQL one of the most popular databases in use today. Unfortunately, a high adoption rate makes MySQL a target for many malicious individuals and organizations. In today's article, Rob Gravelle highlights a few simple but effective ways of beefing up your database security to defend against both local and remote attacks.