The Mimer SQL PSM Debugger
Using Mimer SQL's Java-based graphic PSM Debugger, you can select and run a stored function or stored procedure in an environment that enables you to:
- view the stored source of the routine
- watch the values of the input parameters and declared variables
- observe the results of executing the routine.
You can interactively set breakpoints in the routine being debugged or in other routines or triggers invoked by this routine. When a breakpoint is set the execution will halt at this line, if encountered in the flow of execution.
You can execute a routine in step-wise fashion from the beginning or from the point at which a breakpoint halts execution.
When execution of a routine is interrupted or when a routine is executed in a step-wise fashion, an indicator next to the source line will show the current flow of control position.
The PSM Debugger requires a Java 2 (version 1.2 or later) compatible Java runtime environment.
Win: You can download the Java runtime environment files from: http://www.java.com
Starting the PSM Debugger
To start the PSM Debugger:
UNIX: Enter the following command:java -jar /usr/lib/psmdebug.jarOn Linux and Mac OS X, the PSM Debugger can also be started from the Start Menu.
VMS: The PSM debugger is not included in the VMS distribution. PSM procedures can be debugged remotely from a workstation using another graphical operating system.
The PSM Debugger window opens and the log in dialog box is displayed.
Logging in to the Mimer SQL PSM Debugger establishes a connection to a database server and enables you to access the routines stored in the database.
To log in:
- In the login dialog box, enter the following details:
For example:localhost/testdb The name of the ident you wish to use to access the database. The password to be used for the specified ident.
- Click OK to connect to the database, or Cancel to quit the Mimer SQL PSM Debugger.
Once you have logged in to the Mimer SQL PSM Debugger, you will be accessing the database as the ident you specified in the log in dialog box and you can choose a routine to debug by selecting it from the Choose a procedure drop-down list.
Choosing a Routine
Choose a stored function or stored procedure to debug by selecting it from the drop-down list.
The list displays the routines for which you hold
EXECUTEprivilege. When you have selected a routine, you must specify values for all the input parameters.
Specifying the Input Parameters
When you select a routine with input parameters, a dialog box will list the name and data type of each input parameter and you must specify values for them.
When you have specified values for all the input parameters, click OK to view the source for the routine, or click Cancel to go back to selecting a routine from the drop-down list.
Viewing the Source Code for a Routine
When you have selected a routine and specified the input parameter values, the routine source is displayed.
It is possible to watch the values of declared variables and routine parameters declared as input or input/output by selecting them from the Variable details drop-down list.
You can set a breakpoint on a line of the routine source by clicking on the indicator to the left of the source line in the source window.
Watching Variables and Input Parameters
Once you have selected a variable or parameter from the drop-down list, its name and current value (when defined) are shown in the table below the list.
The watched values are updated in the table as the routine executes.
To set a breakpoint in a routine or trigger invoked by the current routine, you can choose a routine or a trigger from the list in the Breakpoints menu.
When you click on the indicator to left of a source line in the source window, the indicator will change color.
If the indicator is red, there is a breakpoint set on that source line which will halt execution of the routine when it is encountered.
If the indicator next to a source line is white, then no breakpoint is set on that line.
Executing a Routine
To execute a routine:
- Click Go to execute the routine to the end or to the next breakpoint.
- Click Step Into to execute the next line. If this line contains a call statement or a function invocation, the execution will halt at the first line in the invoked routine.
- Click Step Over to execute the next line. This mode will not stop the execution if there is a routine invocation, unless there is a breakpoint set.
- Click Cancel to force continuous routine execution to stop.
Whenever the value of a watched variable or parameter changes, the value shown for it in the table will be updated and will be displayed in red. Unchanged values will be displayed in black.
When execution of a routine is halted by a breakpoint, flow of control is positioned just before execution of the source line on which the breakpoint is set. An arrow to the left of the source line shows where execution has been halted.
To continue executing a routine that has been halted at a breakpoint, click Go, Step Into or Step Over.
Whenever execution of a routine is halted, because a breakpoint was encountered or during step-wise execution, the source line at which the routine is halted appears with an arrow to the left of it. The current flow of control position is just prior to execution of that source line.
The results of executing the routine are shown in the window below the routine selection drop-down list. The Mimer SQL PSM Debugger gives the same results feedback during execution of a routine as Mimer BSQL.
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40