create or replace procedure swap( num1 in out integer,num2 in out integer)
Is
temp integer:=0;
begin
temp:=num1;
num1:=num2;
num2:=temp;
end;
/
declare
a integer:=&a;
b integer:=&b;
begin
dbms_output.put_line('Before swaping '||a||' '||b);
swap(a,b);
dbms_output.put_line('After swaping '||a||' '||b);
end;
/
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter