In this PL/SQL program, you will perform swapping two numbers using a procedure of PL/SQL
declare
x number;
y number;
temp number;
procedure MySwap(a in out number,b in out number)
is
begin
dbms_output.put_line('before swapping a='||a||' b='|| b);
temp:=a;
a:=b;
b:=temp;
dbms_output.put_line('After swapping a='||a||' b='|| b);
end;
begin
x:=&x;
y:=&y;
MySwap(x,y);
end;
/
Enter value for x: 10 old 15: x:=&x; new 15: x:=10; Enter value for y: 12 old 16: y:=&y; new 16: y:=12; before swapping a=10 b=12 After swapping a=12 b=10