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
what is cross join? : Sql dba
What are keys in sql?
what is the difference between undefined value and null value? : Sql dba
What is the difference between a query and a report?
what are enums used for in mysql? : Sql dba
Why we use sql profiler?
How sql query is executed?
What is varchar data type in sql?
What are different types of triggers?
What is procedure and function?
What are the topics in pl sql?
Can we debug stored procedure?
Are subqueries faster than joins?
How to start oracle sql developer?
What is a pl/sql block?