myProc procedure with a default value for both parameters : IN Parameters « Function Procedure Packages « Oracle PL/SQL Tutorial






SQL> CREATE OR REPLACE PROCEDURE myProc(ip_line_length IN NUMBER DEFAULT 50,ip_separator IN VARCHAR2 DEFAULT '=')
  2  IS
  3
  4    myString VARCHAR2(150);
  5
  6  BEGIN
  7
  8    FOR idx in 1..ip_line_length LOOP
  9
 10      myString :=myString ||ip_separator;
 11
 12    END LOOP;
 13
 14    DBMS_OUTPUT.PUT_LINE(myString);
 15
 16  EXCEPTION WHEN OTHERS THEN
 17    dbms_output.put_line(SQLERRM);
 18  END;
 19  /

Procedure created.

SQL>








27.15.IN Parameters
27.15.1.IN Parameters in action
27.15.2.Named notation
27.15.3.Mixed notation
27.15.4.myProc procedure with a default value for one parameter
27.15.5.myProc procedure with a default value for both parameters