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
How do I tune a sql query?
How to display the records between two range in Oracle SQL Plus?
What is mdf ldf and ndf?
What is interval partition?
Do prepared statements prevent sql injection?
What information is needed to connect sql*plus an oracle server?
what is an alias command? : Sql dba
What is the purpose of the partition table?
how to use like conditions? : Sql dba
What are the types of dbms?
What is type and rowtype in pl sql?
What is pragma in sql?
what is difference between delete and truncate commands? : Sql dba
What is pl sql architecture?
Does execute immediate commit?