How can I use IN OUT parameter in a procedure. I want to give a parameter as both input and get the same out put? can i have an example for this?
Do this in SQL Plus:
set serverout on
declare
l_val varchar2(30) := 'hello world';
procedure myproc (p_val in out varchar2) is
begin
dbms_output.put_line('p_val was ' || p_val);
p_val := 'something else';
end;
begin
myproc(l_val);
dbms_output.put_line('l_val is now ' || l_val);
end;
/
You should see the output:
p_val was hello world
l_val is now something else