Re: Debugging stored procedures (simple tip)
Great tip Lawrence.
What would be great is extending that slightly by putting the insert into another procedure (called mysql_debug or something) and then just calling that, I'd also extend it to have some sort of sequence number so I could tell where I was in the procedure. Then also have another procedure to show the contents of the table once the procedure is complete. Doing it this way it would also be easy to turn debugging on and off, so either globally or locally to your procedure you can set a value which tells the mysql_debug procedure to write to the table or not.
When I'm developing Oracle stored procedures I use script files and then have a show errors command at the end that way when I load the script it automatically shows any compile errors. You could do the same with MySQL but just use the new show procedure to output the contents at the end.
I've had plans for a debugging section over at
http://www/MySQLDevelopment.com so if anybody is interested in developing on Lawrence's idea (or even Lawrence himself) I'd love to hear from you.
andrew_gilfrin@mysqldevelopment.com
Andrew Gilfrin
------------------
http://gilfster.blogspot.com
My MySQL related Blog
http://www.mysqldevelopment.com
MySQL Stored Procedure,Trigger, View.... (Just about most things these days) Information
Subject
Views
Written By
Posted
4492
October 04, 2005 08:53AM
Re: Debugging stored procedures (simple tip)
3596
October 11, 2005 07:19AM
2498
October 31, 2005 04:47PM
6707
November 07, 2005 07:02AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.