Wrapping a task into a procedure : Procedure « Function Procedure Packages « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL>
SQL> declare
  2      v VARCHAR2(50):= 'I just printed my <in> line!';
  3      procedure p_print(i_string in VARCHAR2, i_replace in VARCHAR2 := 'new') is
  4      begin
  5          DBMS_OUTPUT.put_line(replace(i_string,'<in>', i_replace));
  6      end;
  7  begin
  8      p_print (v,'first');
  9      p_print (v,'second');
 10      p_print (v);
 11  end;
 12  /
I just printed my first line!
I just printed my second line!
I just printed my new line!

PL/SQL procedure successfully completed.

SQL>








27.5.Procedure
27.5.1.Procedures
27.5.2.A procedure block.
27.5.3.Wrapping a task into a procedure
27.5.4.Storing PL/SQL procedure in the Database
27.5.5.Creating stored procedures
27.5.6.Execute a procedure
27.5.7.Demonstration of a nested procedure block
27.5.8.Create or replace a procedure
27.5.9.Calling a Procedure
27.5.10.Pass ROWTYPE to a procedure
27.5.11.Insert debug line to the stored procedure with DBMS_OUTPUT.PUT_LINE
27.5.12.Listing Stored Procedure Information
27.5.13.Decrease salary with user procedure
27.5.14.Forward Referencing