This example shows how to debug a stored function in dbForge Studio for Oracle. Use provided scripts to create sample objects in your test database.
Use the script available in Debugging a Stored Procedure to the procedure used in the sample below.
Use the script below to create the GetFirstDayOfMonth function that returns the first day of a calendar month.
CREATE OR REPLACE FUNCTION GetFirstDayOfMonth(DT DATE) RETURN DATE AS BEGIN RETURN TRUNC(DT, 'MONTH'); END;
To debug the Oracle function:
Click in the gray margin next to the SELECT statement to insert a breakpoint in the place where we call the GetFirstDayOfMonth stored function.
Step through the code using the F11 key or the Step Into button, or press CTRL+F5 to move directly to the breakpoint.
Press F11 or click Step Into to get inside the GetFirstDayOfMonth stored function.
You may ignore stepping through the function by clicking the Step Over button. In this case, you will continue stepping through the stored procedure.
You may get back to the stored procedure code by clicking the Step Out button. In this case, you will continue stepping through the stored procedure.
You may click the FILLSCHEDULE procedure in the Call Stack window to get back to the parent code.
Place the mouse pointer over a variable to see its value.