602SQL Documentation Index  

Procedure and Function Designer

The text editor allows the creation and modification of routines (SQL procedures and functions) in the 602SQL Client. A new routine in the editor is prefilled with the basic procedure or function body according to the routine type that is chosen in the dialog before the editor is open (Create a stored function... or Create a stored procedure...). The third option (Create a module containing global declarations) does not create a normal routine, but a special object with a fixed name Module_globals. This object is described in detail here.

You can also create, modify and delete a routine using the CREATE PROCEDURE | FUNCTION, ALTER PROCEDURE | FUNCTION and DROP PROCEDURE | FUNCTION SQL statements.

Testing Routines

You can check routine syntax for error using the Design / Compile action. If a syntax error is found, the error is displayed and the cursor is set near the error occurrence in the text editor.

Executing Routines

A routine that is syntactically correct (and compiled) can be executed using Design / Execute. The Calling routine window will be displayed. This window contains a grid with one routine parameter per row (and one for the function result). Input parameters are marked with In, output parameters with Out, Input-Output with InOut and the function result with Ret. The other columns are parameter name, parameter type, and parameter values. Input parameters values are set before execution and output parameters values are displayed after the routine is executed. The Call button executes the routine. If the Run in debug mode checkbox is checked, the routine will stop and the debug process will begin on the first command. You can find more information about routine debugging here.