By default, the parameter mode is IN
. However, specifying it explicitly makes the code easier to read.
Noncompliant code example
SET SERVEROUTPUT ON
DECLARE
PROCEDURE printName(name VARCHAR2) AS -- Noncompliant; relies on default mode
BEGIN
DBMS_OUTPUT.PUT_LINE('name: ' || name);
END;
BEGIN
printName('Foo');
END;
/
Compliant solution
SET SERVEROUTPUT ON
DECLARE
PROCEDURE printName(name IN VARCHAR2) AS
BEGIN
DBMS_OUTPUT.PUT_LINE('name: ' || name);
END;
BEGIN
printName('Foo');
END;
/