there are 2 variables called x and y ,x contains 1,2 and y
contains 3,4 we have to swap the values from x to y and y
to x with out using dummy variables and it can be done only
by using a single statement ? how?

Answer Posted / parivesh sinha

declare
x number:=1;
x1 number:=2;
y number:=3;
y1 number:=4;
begin
x := y1- y;
dbms_output.put_line (x);
x1 := y1+1 - y;
dbms_output.put_line (x1);
y := x +x1;
dbms_output.put_line (y);
y1 := x1+1 +x;
dbms_output.put_line (y1);
end;

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sqlite format?

633


Is mariadb a nosql database?

542


How is data stored in sql?

551


Can we debug stored procedure?

525


Which table is left in join?

516






How can a function retun more than one value in oracle with proper example?

586


What is the best partition size for windows 10?

487


How can I delete duplicate rows?

564


Why do we use procedures?

519


What do you know by pl/sql cursors?

568


What is record in pl sql?

593


how to convert character strings to dates? : Sql dba

525


what is 'mysqlshow'? : Sql dba

589


Why plvtab is considered as the easiest way to access the pl/sql table?

619


What is the command used to fetch first 5 characters of the string?

886