O'Reilly logo

Advanced Oracle PL/SQL Programming with Packages by Steven Feuerstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2.4. Organizing Package Source Code

Most Oracle shops still rely on SQL*Plus to create and compile PL/SQL programs. This means that the source code resides in one or more operating system files. To avoid losing control of that source, you should adopt some simple conventions for the extensions of your files. The approach I have taken is shown in the table below.

File ExtensionDescription
procname.spThe definition of a stored procedure.
funcname.sfThe definition of a stored function.
pkgname.sppA stored package definition that contains the code for both the package specification and the package body.
pkgname.spsThe definition of a stored package specification only.
pkgname.spbThe definition of a stored package body only.
scriptname.sqlAn anonymous PL/SQL block or a SQL*Plus script (SQL statement plus SQL*Plus commands).
procname.wpThe wrapped[2] definition of a stored procedure.
funcname.wfThe wrapped definition of a stored function.
pkgname.wppA stored package definition that contains the wrapped code for both the package specification and the package body.
pkgname.wpsThe wrapped definition of a stored package specification only.
pkgname.wpbThe wrapped definition of a stored package body only.
scriptname.sqlAn anonymous PL/SQL block or a SQL*Plus script (SQL statement plus SQL*Plus commands).

[2] As of PL/SQL Release 2.2, you can "wrap" your PL/SQL source code into an encrypted format. This format can be compiled into the database, but is not readable. Wrapped code is primarily of value ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required