Please note : This help page is for an older version of Enteprise Archtiect. The latest help can be found here.

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' dialog for the element and, in the 'Stereotype' field, type the value 'Package'.

Click on the OK button.

3

Click on the element and press F10, to display the 'Features' dialog 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

Click on the 'Behavior' tab and on the Initial Code button, and type the entire Package specification into the Initial Code screen.

5

Return to the main panel of the 'Features' dialog and, for the Package body, press Ctrl+N and create an Operation with the name 'Body' and with no return type.

6

Click on the 'Behavior' tab and on the Initial Code button, and type the entire Package body code into the Initial Code screen.

Learn more