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 / roopesh kumar
declare
x number:= 1;
y number:= 2;
begin
x := x + y;
dbms_output.put_line (x); -- output 3;
y := x - y;
dbms_output.put_line (y); -- output 1;
x := x - y;
dbms_output.put_line (x); -- output 2;
end;
/
| Is This Answer Correct ? | 8 Yes | 5 No |
Post New Answer View All Answers
How to know the last executed procedure?
Which are the different case manipulation functions in sql?
How do you explain an index?
How to sort the rows in sql.
What is a natural join sql?
Explain the difference between triggers and constraints?
list out some tools through which we can draw e-r diagrams for mysql. : Sql dba
Why do we use partitions in sql?
how to delete an existing column in a table? : Sql dba
What is a data definition language?
How to fetch alternate records from a table?
Write a program that shows the usage of while loop to calculate the average of user entered numbers and entry of more numbers are stopped by entering number 0?
Why we use cross join?
How to set up sql*plus output format in oracle?
What is a table in a database?