G-7240: Avoid using an IN OUT parameter as IN or OUT only.

Major

Efficiency, Maintainability

Reason

By showing the mode of parameters, you help the reader. If you do not specify a parameter mode, the default mode is IN. Explicitly showing the mode indication of all parameters is a more assertive action than simply taking the default mode. Anyone reviewing the code later will be more confident that you intended the parameter mode to be IN / OUT.

Example (bad)

-- Bad
CREATE OR REPLACE PACKAGE BODY employee_up IS
   PROCEDURE rcv_emp (io_first_name     IN OUT employees.first_name%TYPE
                     ,io_last_name      IN OUT employees.last_name%TYPE 
                     ,io_email          IN OUT employees.email%TYPE 
                     ,io_phone_number   IN OUT employees.phone_number%TYPE
                     ,io_hire_date      IN OUT employees.hire_date%TYPE 
                     ,io_job_id         IN OUT employees.job_id%TYPE
                     ,io_salary         IN OUT employees.salary%TYPE
                     ,io_commission_pct IN OUT employees.commission_pct%TYPE 
                     ,io_manager_id     IN OUT employees.manager_id%TYPE
                     ,io_department_id  IN OUT employees.department_id%TYPE
                     ,in_wait                  INTEGER) IS
      l_status PLS_INTEGER;
      co_dflt_pipe_name CONSTANT STRING(30 CHAR) := 'MyPipe';
      co_ok CONSTANT PLS_INTEGER := 1;
   BEGIN
      -- Receive next message and unpack for each column. 
      l_status := SYS.dbms_pipe.receive_message(pipename => co_dflt_pipe_name
                                               ,timeout  => in_wait);
      IF l_status = co_ok THEN
         SYS.dbms_pipe.unpack_message (io_first_name);
         SYS.dbms_pipe.unpack_message (io_last_name);
         SYS.dbms_pipe.unpack_message (io_email);
         SYS.dbms_pipe.unpack_message (io_phone_number);
         SYS.dbms_pipe.unpack_message (io_hire_date);
         SYS.dbms_pipe.unpack_message (io_job_id);
         SYS.dbms_pipe.unpack_message (io_salary);
         SYS.dbms_pipe.unpack_message (io_commission_pct);
         SYS.dbms_pipe.unpack_message (io_manager_id);
         SYS.dbms_pipe.unpack_message (io_department_id);
      END IF;
   END rcv_emp;
END employee_up;
/

Example (good)

CREATE OR REPLACE PACKAGE BODY employee_up IS
   PROCEDURE rcv_emp (OUT_first_name     OUT employees.first_name%TYPE
                     ,OUT_last_name      OUT employees.last_name%TYPE 
                     ,OUT_email          OUT employees.email%TYPE 
                     ,OUT_phone_number   OUT employees.phone_number%TYPE
                     ,OUT_hire_date      OUT employees.hire_date%TYPE 
                     ,OUT_job_id         OUT employees.job_id%TYPE
                     ,OUT_salary         OUT employees.salary%TYPE
                     ,OUT_commission_pct OUT employees.commission_pct%TYPE 
                     ,OUT_manager_id     OUT employees.manager_id%TYPE
                     ,OUT_department_id  OUT employees.department_id%TYPE
                     ,in_wait            IN     INTEGER) IS
      l_status PLS_INTEGER;
      co_dflt_pipe_name CONSTANT STRING(30 CHAR) := 'MyPipe';
      co_ok CONSTANT PLS_INTEGER := 1;
   BEGIN
      -- Receive next message and unpack for each column. 
      l_status := SYS.dbms_pipe.receive_message(pipename => co_dflt_pipe_name
                                               ,timeout  => in_wait);
      IF l_status = co_ok THEN
         SYS.dbms_pipe.unpack_message (out_first_name);
         SYS.dbms_pipe.unpack_message (out_last_name);
         SYS.dbms_pipe.unpack_message (out_email);
         SYS.dbms_pipe.unpack_message (out_phone_number);
         SYS.dbms_pipe.unpack_message (out_hire_date);
         SYS.dbms_pipe.unpack_message (out_job_id);
         SYS.dbms_pipe.unpack_message (out_salary);
         SYS.dbms_pipe.unpack_message (out_commission_pct);
         SYS.dbms_pipe.unpack_message (out_manager_id);
         SYS.dbms_pipe.unpack_message (out_department_id);
      END IF;
   END rcv_emp;
END employee_up;
/