G-7160: Always explicitly state parameter mode.
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
or in out
.
Example (bad)
| create or replace package employee_api is
procedure store(io_id in out employees.id%type
,in_first_name employees.first_name%type
,in_last_name employees.last_name%type
,in_email employees.email%type
,in_department_id employees.department_id%type
,out_success out pls_integer);
end employee_up;
/
|
Example (good)
| create or replace package employee_api is
procedure store(io_id in out employees.id%type
,in_first_name in employees.first_name%type
,in_last_name in employees.last_name%type
,in_email in employees.email%type
,in_department_id in employees.department_id%type
,out_success out pls_integer);
end employee_up;
/
|