Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?

Answers were Sorted based on User's Feedback



there are 2 variables called x and y ,x contains 1,2 and y contains 3,4 we have to swap the values..

Answer / 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

there are 2 variables called x and y ,x contains 1,2 and y contains 3,4 we have to swap the values..

Answer / santhi k

IN ORACLE...

SELECT DECODE(X,X,Y)X,DECODE(Y,Y,X)Y FROM TABLENAME;

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More SQL PLSQL Interview Questions

explain advantages of innodb over myisam. : Sql dba

0 Answers  


How do I run sql profiler?

0 Answers  


Why do we go for stored procedures?

0 Answers  


How many primary keys can a table have?

0 Answers  


What is a join?

0 Answers  


What is asqueryable?

0 Answers  


What is execute immediate?

0 Answers  


What is cursor in pl sql?

0 Answers  


What is your daily office routine?

0 Answers   Data Vision,


What is meant by Join? What are the different types of Joins available? Explain.

5 Answers   Cap Gemini,


How to change the order of columns in Oracle SQL Plus ?

0 Answers   MCN Solutions,


what are date and time intervals? : Sql dba

0 Answers  


Categories