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
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 |
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 |
Can we interchange parameters in procedure while calling
What are sql*plus environment variables?
How is data stored in sql?
hi sql gurus, here is my question 4 u. i wanna use triggers for sending reminder mail to all users who are registered to the site. if any one knws the code plz send me ans here : chayabs3@gmail.com thnx advance
1. is it possible to use the cursor atttibutes (%found ,% rowcount , %isopen , %notfound ) to our user defined cursor names ....... cursor cursor_name is select * from scott.emp if you use... cursor_name%found , %rowcount ,%isopen,%notfound...will it work... -------------------------- 2.what is the difference between the varray and index by table .. -------- 3. type type_name is table of number(8,3) index by binary_integer; identifier_name type_name; first , last , prior , next ,trim are the methods we can use it for the above type...simillary is there any way to apply for cursors... with thanks and regards..sarao...
What is sqlite format?
explain normalization concept? : Sql dba
Its possible to add more than one primary key for the table
What is integrity in sql?
What are the types of variable use in pl sql?
Does db2 use sql?
Hello All, Could any well write a query for the following scenario. Account(table name) No Name Amount 1 ABCD 2000.00 2 DEFG -2000.00 3 GHIJ 3000.50 4 JKLM 4000.00 5 MNOP 6000.00 O/p Should be in this format No Name Credit Debit 1 ABCD 2000.00 0 2 DEFG 0 -2000.00 3 GHIJ 3000.50 4 JKLM 0 -4000.00 5 MNOP 6000.00 o could any one give appropriate query for this Thnks in Advance