Prev Next

Oracle Packages

Oracle Packages are database objects that are unique to the Oracle DBMS. They are containers that group logically-related objects into a single definition. Packages have two parts - a specification and a body. The:

  • Specification section declares the various components
  • Body section provides the full definitions of the components

The Package components can consist of Types, Variables, Constants, Exceptions, Cursors and subprograms.

In Enterprise Architect, an Oracle Package is modeled as a UML Class with a stereotype of <<package>>. It has two operations:

  • Specification
  • Body

For each of these operations the complete SQL syntax is contained in the 'Initial Code' field.

Create an Oracle Package

Step

Action

See also

1

Add a Class element to your data model.

2

Open the Properties window for the element and, in the 'Stereotype' field, type the value 'Package'.

3

Click on the element and press F10, to display the Features window at the 'Operations' page.

For the Package specification, press Ctrl+N and create an operation with the name 'Specification' and with no return type.

4

The Properties window displays the properties of the operation; click on the 'Code' tab and type the entire Package specification into the text panel.

5

Return to the Features window at the 'Operations' page and, for the Package body, press Ctrl+N and create an operation with the name 'Body' and no return type.

6

On the Properties window, click on the 'Code' tab and type the entire Package body code into the text panel.

Learn more