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 do you write an inner join query?
difference between anonymous blocks and sub-programs.
What is procedure function?
Explain the rollback statement?
How does rowid help in running a query faster?
how can we know the number of days between two given dates using mysql? : Sql dba
What are the types of queries in sql?
What is the difference between partitioning and sharding?
Which normal form is best?
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5
How does join work in sql?
Write an sql query to select all records from the table?
What is an oracle stored procedure?
what is row? : Sql dba
what are ddl statements in mysql? : Sql dba