Executing PSM

Compile

The users can compile PSM statements except anonymous statements through the compile button on the Toolbar, Run Query > Compile from the Context Menu or the shortcut (Ctrl+Shift+P).

If the compile succeeds, a success message is displayed and the CRAETE (OR REPLACE) syntax is executed.

If it fails, an error message is displayed and the error is displayed on the Error tab.

Figure 1. Compile success screen

Figure 2. Compile fail screen

Run

The users can execute PSM statements, including anonymous statements through clicking the PSM Run button on the Toolbar, Run Query > Run from the Context Menu, or using the shortcut (Ctrl+Shift+N).

Anonymous statements

If the users create an anonymous statement and run it, the text accumulated in the buffer is displayed on the Result > DBMS Output tab along with a message when the execution is successful.

Figure 3. Executing Anonymous Statement

Procedure, Function

For Procedure and Function statements, when Run is executed, the Parameter input window is displayed. The window is divided into two main areas: the PSM Block area at the top and the Parameter list area at the bottom.

In the PSM Block area at the top, the users can see the PSM statements that are converted to anonymous statements and actually executed. The users can also specify whether to commit or roll back using the Commit and Rollback checkboxes.

In the Parameter list area at the bottom, the users can see the list of parameters of the program and specify the values to be passed as Arguments. In the bottom table, double-click the Value area to switch to the parameter input mode, enter the value, and press Enter to apply the value.

After checking the PSM statement and entering the value, click the [OK] button to run the subprogram.

Figure 4. PSM Bind Parameter screen
Figure 5. Entering the PSM Bind Parameter screen value
Figure 6. The result after executing PSM Procedure

Package Body

In the case of Package Body, it is not possible to run the entire package, but it is possible to run each subprogram through the subprogram tree.

Create a Package Body statement and execute Compile. After successful compilation, open the Subprogram tree from the PSM Editor Toolbar > Subprogram menu or the shortcut (Ctrl + G) to see the list of Packages and Subprograms in a tree structure in the Subprogram tree on the left side of the PSM Editor.

The users can run the Package Subprogram by calling the Context Menu by right-clicking on the Subprogram item and then clicking the [Run] menu. When The users click [Run], the Parameter input window is displayed just like running Procedure / Function.

After checking the PSM statement and entering the value, The users can run the subprogram by clicking [OK] button.

Figure 7. Execution of Package Body Subprogram
Figure 8. Package Subprogram Run Bind Parameter
Figure 9. The result of exectuing Package Subprogram

Last updated