Debugging stored procedures (simple tip)
I haven't seen anyone mention this so...
Since errors received during execution of procedures can be misleading (and there's no debugger), I've found creating a MyISAM table like "CREATE TABLE foo (bar VARCHAR(512));" then sprinkling the procedure code with statements like "INSERT INTO foo VALUES (CONCAT('Got var=',var));" to be very helpful. Just truncating the table before the next run and then performing a "SELECT * FROM foo;" gets your messages in the order they were added. Plus, being a MyISAM table means an error does not reverse the messages you stuffed in there.
Hope this helps someone.
Subject
Views
Written By
Posted
Debugging stored procedures (simple tip)
4492
October 04, 2005 08:53AM
3597
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.