Creating a local program unit Creating a stored program unit

How To... 4-119 ■ Creating a local program unit ■ Creating a stored program unit ■ Deleting a program unit ■ Moving a program unit between client and database server ■ Creating a report trigger ■ Deleting a report trigger ■ Creating a database trigger

4.13.3.1 Creating a local program unit

To create a local client-side program unit:

1. In the Object Navigator, click the Program Units node.

2. Click the Create button in the toolbar.

3. In the dialog box, type a name for the program unit in the Name text box.

4. If your program unit is not a procedure a PLSQL subprogram that performs a

specified sequence of actions, click one of the following: ■ Function a PLSQL subprogram that performs a specified sequence of actions, and then returns a value ■ Package Spec datatypes and subprograms that can be referenced by other program units ■ Package Body implementation of the package, which may include private subprograms and datatypes; optional if the package consists only of declarations

5. Click OK.

6. In the PLSQL Editor, define the PLSQL for the program unit.

See also Section 2.6.4, About program units

4.13.3.2 Creating a stored program unit

To create a stored server-side program unit:

1. In the Object Navigator, double-click the Database Objects node. If this node is

disabled, the Connect dialog box displays so you can establish a database connection. 2. Expand the subnode that corresponds to the database user name you used to log in to the database to show the PLSQL Stored Program Units node.

3. Click the PLSQL Stored Program Units node, then click the Create button in the

toolbar.

4. In the dialog box, type a name for the program unit in the Name text box.

Note: If the radio button is not selected when you click, try clicking a different radio button, then click the desired Type again. 4-120 Oracle Reports Users Guide to Building Reports 5. If your program unit is not a procedure a PLSQL subprogram that performs a specified sequence of actions, click one of the following: ■ Function a PLSQL subprogram that performs a specified sequence of actions, and then returns a value ■ Package Spec datatypes and subprograms that can be referenced by other program units ■ Package Body implementation of the package, which may include private subprograms and datatypes; optional if the package consists only of declarations ■ Type Spec declares the name, variables attributes and member subprograms methods for an object type or collection type ■ Type Body implementation of the member methods functions and procedures defined in the type specification for an object type. For each method specified in an object type, there must be a corresponding method body

6. Click OK.

7. In the Stored PLSQL Editor, select a database owner name from the Owner list to

indicate where the program unit will be stored in the database, then define the PLSQL for the stored program unit. See also Section 2.6.5, About stored program units

4.13.3.3 Deleting a program unit