Right-click Functions/Procedures and a menu is displayed.



The selected function/procedure or SQL function is displayed in the PL/SQL Viewer tab page.

If you execute the function/procedure or SQL function before compilation, the Source Code Change dialog box is displayed.
A breakpoint is used to stop a PL/SQL program on the line where the breakpoint is set. You can use breakpoints to control the execution and debug the procedure. When a line with a breakpoint set is reached, the PL/SQL program on this line will be stopped, and you can perform other debugging operations.
Data Studio allows you to set or add breakpoints on a line.
Open the function or procedure for which you want to add a breakpoint, double-click the breakpoint ruler on the left of the line number field, and set a breakpoint. If the breakpoint is enabled, the operation is successful. If the function is not interrupted or stopped during debugging, the breakpoint set for the function is not validated.
You can view and manage all breakpoints in the Breakpoints pane. Click the breakpoint option at the minimized pane to open the Breakpoints pane.
You can enable, disable or remove a specific breakpoint by selecting the breakpoint check box and clicking the enabling, disabling, and removing icon in the Breakpoints pane. You can also double-click the breakpoint ruler on the left of the line number field to set a breakpoint or double-click the breakpoint icon to delete the breakpoint.
In the PL/SQL Viewer pane, double-click the required breakpoint in the Breakpoint Info column to locate the breakpoint.

During debugging, if the source code is changed after it is fetched from the server and the debugging is continued, Data Studio displays an error. You are advised to refresh the object and perform the debug operation again.
If you change the source code obtained from the server and execute or debug the source code without setting a breakpoint, the result of the source code obtained from the server will be displayed on Data Studio. You are advised to refresh the source code before executing or debugging it.
After adding a breakpoint in the row you want to debug, click the debug icon or right-click the selected function in Object Browser and select Debug. In the Debug Function/Procedure dialog box, enter the parameter information.



Setting/Displaying Variables |
Description |
|---|---|
Setting a variable to NULL |
|
Setting a string value |
Some examples are as follows:
|
Setting a BOOLEAN value |
Enclose the BOOLEAN value t or f within single quotation marks ('). For example, to set t to a BOOLEAN variable, enter 't' in the Value column. |
Displaying a variable value |
If the variable value is NULL, it will be displayed as NULL. If the variable value is NULL, it will be displayed as empty. If the variable value is set to a string, for example, abc, it will be displayed as abc. |
Click the terminating debugging button on the toolbar or choose Debug > Terminate Debugging. After the debugging is complete, the function execution proceeds and will not be stopped at any breakpoint.
After the debugging is complete, the result tab page displays the function execution result, and the Callstack and Variables panes are cleared.
You can run the command for single stepping in the toolbar to debug a function. This allows you to debug the program line by line. When a breakpoint occurs during the operation of single stepping, the operation will be suspended and the program will be stopped.
Single stepping means executing one statement at a time. Once a statement is executed, you can see the execution result in other debugging tabs.
A maximum of 100 PL/SQL Viewer tabs can be displayed at a time. If more than 100 tabs are opened, the tabs of function calls will be closed. For example, if 100 tabs are opened and a new debugging object is called, Data Studio will close the tabs of function calls and open the tab of the new debugging object.
To step through code one statement at a time, select Step Into from the Debug menu.
When stepping into a function, Data Studio executes the current statement and then enters the break mode. The debug position will be indicated by an arrow
on the left ruler pane. If the execution statement calls another function, Data Studio will step into that function. Once you have stepped through all the statements in that function, Data Studio jumps to the next statement of the function it was called from.
Press F7 to go to the next statement. If you click Continue, PL/SQL code execution will continue.

Step Over is the same as Step Into. Unless another function is called, it will not step into the function. The function will run, and the next statement in the current function is executed. F8 is the shortcut key for Step Over. However, if there is a breakpoint set inside the called function, Step Over will enter the function, and hit the set breakpoint.
Stepping out of a sub-program continues the execution of the function and then suspends the execution after the function returns to its function call. You can step out this function when the rest of the function does not need to debug. However, if a breakpoint is set in the remaining part of the function, then that breakpoint will be hit before returning to the function call.
A function will be executed when you step over or step out of it. Shift+F7 is the shortcut key for Step Out.

When the debugging process stops at a specific location, you can select Continue (or press F9) from the Debug menu to continue the PL/SQL function execution.
The Callstack pane displays the chain of functions as they are called. The Callstack pane can be opened from the minimized window. The most recent functions are listed at the top, and the least recent at the bottom. At the end of each function name is the current line number in that function.
You can double-click the function names in the Callstack pane to open panes of different functions.

Follow the steps below to export the function/procedure DDL:
You need to customize the export path. To compress data, select .zip.

You must select I agree under Security Disclaimer, then click OK. You can disable the security disclaimer. After the disclaimer is disabled, it will not be displayed when you export the DDL. For details, see Table 1.
The Data Exported Successfully dialog box and status bar display the status of the completed operation.
Database Encoding |
File Encoding |
Support for Exporting a DDL |
|---|---|---|
UTF-8 |
UTF-8 |
Yes |
GBK |
Yes |
|
LATIN1 |
Yes |
|
GBK |
GBK |
Yes |
UTF-8 |
Yes |
|
LATIN1 |
No |
|
LATIN1 |
LATIN1 |
Yes |
GBK |
No |
|
UTF-8 |
Yes |
You can delete functions or programs one by one or in batches.
The status bar displays the status of the completed operation.