How to print messages from MySQL for debugging purposes?
I'm more of a MS-SQL / PostgreSQL guy, but I'm working on a MySQL project. In one of my sprocs (functions)开发者_开发百科 I would like to simply output the value of a variable at runtime for debugging purposes.
With PostgreSQL, this is done using RAISE NOTICE. This there an equivalent method in MySQL?
This is not available for MySQL.
But you can create something similar yourself by storing debugging values in a separate table as this article describes.
MySQL procs are in their infancy compared to most modern RDBMS. You'll have to use the poor Man's debugging approach - select var from dual where applicable.
精彩评论