Creating a Stored Procedure

How to:

You can code a stored procedure in a text editor that is easily accessible from the Web Console and the Data Management Console.


Top of page

x
Procedure: How to Create a Stored Procedure

You can create procedures from the Web Console or the DMC.

  1. From the Web Console menu bar, click Applications, or from the Data Management Console, expand the Server node folder.

    On the Web Console, the Applications page opens.

  2. Right-click an application folder, select New, and then Procedure.

    A text editing window opens.

  3. Type the procedure code, which may be either FOCUS syntax or SQL Passthru syntax. For example, SQL DB2 SELECT x FROM y ; <newline> END.

    You are responsible for the accuracy of the syntax you enter. However, any errors that are generated will be displayed in the right pane, as well as in the Session Log, which you can access from the My Console option on the menu bar.

  4. Click the Run or Save As icon.

    When you Run the procedure, the output is displayed in the right pane.

    When you Save the procedure, the Save As page opens.

  5. Select an application folder from the Look in drop-down menu, as show in the following image.

  6. Enter a name in the File Name field.
  7. Click OK.

The procedure is added to the application folder in the navigation pane.


iWay Software