Selain menggunakan trik xor di PL/SQL, Anda cukup menggunakan pernyataan SQL
DECLARE
a number := 17;
b number := 42;
BEGIN
SELECT a, b
INTO b, a
FROM dual;
dbms_output.put_line( 'a = ' || a );
dbms_output.put_line( 'b = ' || b );
END;
yang menukar dua variabel tanpa menggunakan variabel temp
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 a number := 17;
3 b number := 42;
4 BEGIN
5 SELECT a, b
6 INTO b, a
7 FROM dual;
8 dbms_output.put_line( 'a = ' || a );
9 dbms_output.put_line( 'b = ' || b );
10* END;
SQL> /
a = 42
b = 17
PL/SQL procedure successfully completed.