Chapter 5 Building Triggers and Procedures


Creating a stored procedure from the list of stored procedures

When you create a stored procedure or function from the list, you can choose to associate a symbol to the procedure or not. To do so you have to select the check box in the Has Symbol column of the stored procedure or function.

Steps To create a stored procedure or a function:

  1. Select Model→Procedures.

    The List of Procedures appears.
  2. Click a blank line in the list.

    or

    Click the Add a Row tool.

    An arrow appears at the beginning of the line.
  3. Type a procedure or function name and code.
  4. Select or clear the check box in the Has Symbol column.
  5. Click Apply.

    The creation of the new procedure or function is committed.
  6. Click the new procedure or function line.

    An arrow appears at the start of the line.
  7. Click the Properties tool.

    or

    Double-click the arrow at the start of the line.

    The property sheet for the new procedure or function opens to the General page.
  8. Click the Definition tab.

    The Definition page appears.
  9. Select Procedure from the dropdown list box at the top of the page.

    or

    Select Function from the dropdown list box at the top of the page.

    The template definition appears in the text box.
  10. Type the procedure or function definition code in the text box.

    Note   Inserting script items
    You can insert script items into the definition as follows:
    Click in the definition where you want to insert a script item. Click a script item tool.
    Select a script item from the menu.
    The script item appears at the click point.

  11. Click OK in each of the dialog boxes.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.