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 Extension | Description |
---|---|
procname.sp | The definition of a stored procedure. |
funcname.sf | The definition of a stored function. |
pkgname.spp | A stored package definition that contains the code for both the package specification and the package body. |
pkgname.sps | The definition of a stored package specification only. |
pkgname.spb | The definition of a stored package body only. |
scriptname.sql | An anonymous PL/SQL block or a SQL*Plus script (SQL statement plus SQL*Plus commands). |
procname.wp | The wrapped[2] definition of a stored procedure. |
funcname.wf | The wrapped definition of a stored function. |
pkgname.wpp | A stored package definition that contains the wrapped code for both the package specification and the package body. |
pkgname.wps | The wrapped definition of a stored package specification only. |
pkgname.wpb | The wrapped definition of a stored package body only. |
scriptname.sql | An 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 ...
Get Advanced Oracle PL/SQL Programming with Packages now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.