rules repository

G-7310

🆓
Warning

Avoid standalone procedures – put your procedures in packages.

Reason

Use packages to structure your code, combine procedures and functions which belong together.

Package bodies may be changed and compiled without invalidating other packages. This is a major advantage compared to standalone procedures and functions.

Example

Non-Compliant Example

create or replace procedure my_procedure is
begin
   null;
end my_procedure;
/
Issues
LineColumnMessage
129Put my_procedure in a package.

Compliant Solution - ★★★★★

create or replace package my_package is
   procedure my_procedure;
end my_package;
/

create or replace package body my_package is
   procedure my_procedure is
   begin
      null;
   end my_procedure;
end my_package;
/

References