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 / parivesh sinha
declare
x number:=1;
x1 number:=2;
y number:=3;
y1 number:=4;
begin
x := y1- y;
dbms_output.put_line (x);
x1 := y1+1 - y;
dbms_output.put_line (x1);
y := x +x1;
dbms_output.put_line (y);
y1 := x1+1 +x;
dbms_output.put_line (y1);
end;
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
What is pragma in pl sql?
What language is oracle sql developer?
Is it possible to sort a column using a column alias?
Is it possible to create the following trigger: before or after update trigger for each row?
What is clause?
What is sql table?
Explain the update statement in sql
what is sub-query? : Transact sql
can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba
what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba
How many sql commands are there?
What is file based approach?
how would concatenate strings in mysql? : Sql dba
What do you mean by table in sql?
Write the command to remove all players named sachin from the players table.