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?

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


Please Help Members By Posting Answers For Below Questions

How do I tune a sql query?

959


How to display the records between two range in Oracle SQL Plus?

1134


What is mdf ldf and ndf?

976


What is interval partition?

1042


Do prepared statements prevent sql injection?

934


What information is needed to connect sql*plus an oracle server?

1007


what is an alias command? : Sql dba

1074


What is the purpose of the partition table?

1034


how to use like conditions? : Sql dba

1087


What are the types of dbms?

955


What is type and rowtype in pl sql?

1008


What is pragma in sql?

1059


what is difference between delete and truncate commands? : Sql dba

1105


What is pl sql architecture?

945


Does execute immediate commit?

1196