In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
DbForge Studio for MySQL is a MySQL client that is widely used in Windows platform. It enables MySQL developers and managers to work with others to create and execute queries, develop and debug MySQL programs, and automate the management of MySQL database objects in a convenient environment.
This example shows how to debug stored functions in dbForge Studio for MySQL. Use the provided script to create a sample object in the test database.
Create a sample function
Database table
Use the script in the sample script to create the database tables to create the necessary tables.
Process
Use a script that can be used to debug a stored procedure to the procedure used in the following example.
Function
Use the following script to create the GetFirstDayOfMonth function, which returns the first day of the calendar month.
CREATE FUNCTION GetFirstDayOfMonth (`date` datetime) RETURNS datetimeBEGIN RETURN DATE_ADD (DATE_ADD (LAST_DAY (`date`), INTERVAL-1 MONTH), INTERVAL 1 DAY); END$$
Debug function
Debug the MySQL function:
In Database Explorer, select a test database.
Click procedure, and then double-click the FillSchedule procedure to open it.
3. Click the gray margin next to the SET TimeSheetDate statement to insert the breakpoint where we called the GetFirstDayOfMonth storage function.
4. Click "
Start debugging, and then enter the input parameter values for the procedure.
5. Add the CurrDate variable to the Watches window. This option allows you to track the value of a variable as you step through the code. To add a variable to the Watches window, right-click the CurrDate variable and select
Add Watch to the shortcut menu. The variable will appear in the Watches window.
6. Use the F11 key or the Step Into button to step through the code, or press CTRL + F5 to move directly to the breakpoint.
Notice that when you are in the SET TimeSheetDate statement, the CurrDate variable changes its value from NULL to DATE.
7. Press F11 or click to step to get the internal GetFirstDayOfMonth storage function.
Note: you can ignore stepping into this function by clicking the Skip button. In this case, you will continue to step through the stored procedure.
Step through the GetFirstDayOfMonth function until you exit to the stored procedure and continue to the end.
Note: you can return to the stored procedure code by clicking the pop-out button. In this case, you will continue to step through the stored procedure.
Now, the value of the CurrDate variable does not appear. The reason is that the variable is declared during the FillSchedule process, and you are in a different context at this time. You can add any variable to the Watches window from the current context to track its value.
You can click the FillSchedule procedure in the call Stack window to return to the parent code. Note that, unlike CurrDate, the Date variable is not recognized now.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.