Procedure Editor |
|
|
DbVisualizer 5.1 October 2006 |
http://www.dbvis.com support@dbvis.com |

Figure: The actions menu for the Procedures node
Next a dialog will be displayed in which parameters for the new procedure are entered. This data forms the interface for the procedure. You can leave the parameters and edit them later. The source for the procedure is edited in a later step.
Figure: The create procedure dialog
Use the buttons to the right of the parameter list to insert, remove and move the entries. For every parameter you must supply its Name, leaving Data Type results in the VARCHAR datatype and the Direction is by default set to IN.
Figure: The newly created procedure
Selecting the newly created procedure in the tree will show the source for it in the procedure editor.
Figure: Compiling procedure with errors
If error(s) occur during compilation then the error list will appear below the editor. It lists the row number in the source editor where the error is and an error message. Click the error in the list and it will highlight the corresponding row in the editor. The Status indicator is switched to INVALID if errors are in the procedure. The same applies for the object icon in the tree which shows a little red cross for invalid procedures.
Figure: Compiling procedure with successful result
The status indicator now shows that the procedure is VALID.
You can now test the procedure in the SQL Commander as in the next screen shot
Figure: Running the procedure in SQL Commander
The figure shows the invocation of the moveorder procedure with parameters meaning that all IDs in the ORDERS table between 1 and 3 should be set to Pre-Closed. The second statement selects from the updated table.