You can use different debugging techniques to achieve successful results.CREATE PROCEDURE insertcustomer ( pFirstName VARCHAR ( 255 ), pLastName VARCHAR ( 255 ), pAge INT, PAddress VARCHAR ( 255 ) ) BEGIN DECLARE pUserId INT INSERT INTO Customer ( FirstName, LastName, Age ) VALUES ( pFirstName, pLastName, pAge ) SET pUserId = last_insert_id () INSERT INTO Address ( UserId, Address ) VALUES ( pUserId, pAddress ) ENDįor example here we execute two inserts, the first one adding a customer, while the second insert inserts into the address table. Click Tables and then right-click the required table.Ĭlick Retrieve Data on the shortcut menu.ĭbForge Studio displays the result table.Īs you see, the Debugger for MySQL is a very simple and powerful tool to use.In Database Explorer, choose the required database.To verify this, you can retrieve the data from the table. You can see the message telling us that the stored procedure executed successfully.Click Execute to run the stored procedure. To stop the debugging process, click the Stop button.Now, once you hit the breakpoint, you can see that the value of the TimeSheetDate variable is the date, which is absolutely correct. To do this, click the Restart button on the Debug toolbar. Initialize the TimeSheetDate variable before inserting it into the table. So it can be concluded that the TimeSheetDate variable should be initialized. We know that the TimeSheetDate field cannot accept NULL values. However, as you can see in the Watches window, the value of the TimeSheetDate variable is NULL. Click the Step Into button on the Debug toolbar, or press F11 for stepping through the code.Īfter several clicks you are hitting this breakpoint which means that the current code isn’t ignored.Insert a breakpoint in the place where you insert the TimeSheetDate variable in the enumdays temporary table. Now, you can see that the TimeSheetDate variable appears in the Watches window. Thus, you will be able to track the TimeSheetDate value while debugging. Right-click the TimeSheetDate variable in the source code and then select the Add Watch option on the shortcut menu. Add the TimeSheetDate variable to Watches.You can see that the yellow arrow identifies the stack frame where the execution pointer is currently located. Enter the stored procedure input parameters once again and click OK. Click Yes.įor more information about compiling, read the Compiling Stored Procedures, Functions, and Triggers for Debugging section from the Debug Engine topic.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |