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
List the different type of joins?
Explain alias in sql?
How do you remove duplicate records from a table?
What is the difference between cross join and natural join?
What is the usage of sql functions?
How do you delete data from a table?
What is sql exception?
what is a scheduled jobs or what is a scheduled tasks? : Sql dba
How do I run a pl sql procedure in sql developer?
what are date and time functions in mysql? : Sql dba
Can we join two tables without common column?
What is percent sign in sql?
How to revise and re-run the last sql command?
What is difference between cursor and trigger?
Can two tables have same primary key?