Follow these steps to create Package in Oracle SQL developer.
- On the left side in the connections pane, click on the Schema and expand the node.
- Then from the list of object types, select the Packages node.
- Do the right click on it and from the shortcut menu select New Package option.
- Then a Create Package window will appear.
- Specify the name for the package in the Name field.
- Then click on the OK button and the package will be open in the SQL editor. Below is an example package code.
CREATE OR REPLACE PACKAGE EMP_PACKAGE AS /* TODO enter package declarations (types, exceptions, methods etc) here */ END EMP_PACKAGE;
The above part is a specification for the package. To create a package body, open another SQL editor window and create the package body, as shown in below example.
CREATE OR REPLACE PACKAGE BODY EMP_PACKAGE AS /* TODO enter package declarations (types, exceptions, methods etc) here */ END EMP_PACKAGE;