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
Why coalesce is used in sql?
What is the use of non clustered index?
What are the different dcl commands in sql?
How can we optimize a sql query?
What is dml and ddl?
What is a join?
What are the types of join and explain each?
What is type and rowtype in pl sql?
what is sql server agent? : Sql dba
How is debugging done?
Is inner join faster than left join?
Is left join inner or outer by default?
What is compound trigger?
Can we join 3 tables in sql?
What are some emotional triggers?