MySQL management, tutorials, scripts, coding, programming and tips for database administrators
Rob Gravelle explores the perils of working with dates in MySQL.
Rob Gravelle highlights a gotcha related to MySQL's overflow handling of numeric values that are outside the permissible range of the column data type.
Importing into MySQL from databases of different types is challenging because vendors have their own proprietary tools and SQL extensions. Rob Gravelle presents some software products that can abstract each vendor's particular language so that data may be transferred between them in a seamless process.
For MySQL administrators who would rather not write and maintain their own import code, there are tools that can markedly simplify the importing of data from various sources. Rob Gravelle demonstrates how to use the Navicat Database Admin Tool to acquire data from XML, .csv, .txt, and Excel files.
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.