Chapter 5 Building Triggers and Procedures


Attaching a stored procedure to a table

You can attach a stored procedure to a table when your current DBMS supports stored procedures. This feature lets you update the table or retrieve information from this table.

For example, the stored procedure TABLE_ADDROW can be attached to a table in which you need to insert rows.

Intermodel generation

When you generate an OOM from a PDM, the procedures attached to a table become operations with the <<procedure>> stereotype in the generated class. By attaching procedures to tables, you are able to define class operations in the generated OOM.

When you generate a PDM from an OOM, class operations with the <<procedure>> stereotype become stored procedures attached to the generated table. The operation body is generated as a comment in the procedure definition.

You can attach a table to a procedure from the property sheet of a procedure or the property sheet of a table.

Steps To attach a stored procedure to a table:

  1. Open the table property sheet.
  2. Click the Procedures tab to display the Procedures page.
  3. Click the Add Objects tool to display an object selection list.
  4. Select the stored procedure you want to attach to the table and click OK.

    The stored procedure appears in the list of stored procedures.
  5. Click OK.

 


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