SQL>
SQL>
SQL> create or replace procedure p_print (i_string in VARCHAR2,i_replace in VARCHAR2 := 'new') is
2 begin
3 if i_string is null then
4 return;
5 end if;
6 DBMS_OUTPUT.put_line(replace(i_string,'<in>', i_replace));
7 end;
8 /
Procedure created.
SQL>
SQL>
SQL> declare
2 v VARCHAR2(50):= 'I just printed my <in> line!';
3 begin
4 p_print (v,'first');
5 p_print (v,'second');
6 p_print (v);
7 end;
8 /
I just printed my first line!
I just printed my second line!
I just printed my new line!
PL/SQL procedure successfully completed.
SQL>
SQL>
27.7.Procedure Return |
| 27.7.1. | Return from a procedure |