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...


can we update the table by using cursors can anyone post
the query?

Answers were Sorted based on User's Feedback



can we update the table by using cursors can anyone post the query?..

Answer / bigben

yes you can
declare cursor using FOR UPDATE option

Is This Answer Correct ?    23 Yes 0 No

can we update the table by using cursors can anyone post the query?..

Answer / diana

Yes you can update the table using cursor....
for eg: if you want to update 3 columns like A,B,C the you
can write as:

Update Table_name
Set A = :Host varaible(value)
B = :Host varaible(value)
C = :Host varaible(value)
where current of C1(Cursor name)

Is This Answer Correct ?    9 Yes 0 No

can we update the table by using cursors can anyone post the query?..

Answer / amar

DECLARE
INT NUMBER:=0;
CURSOR C1 IS
SELECT COL1,COL2 FROM TABLE_NAME;
BEGIN
FOR RC IN C1 LOOP
UPDATE TABLE_NAME SET COL_NAME=RC.COL1,COL_NAME=COL2;
CNT:=CNT+1;
END LOOP;
END;

Is This Answer Correct ?    1 Yes 0 No

can we update the table by using cursors can anyone post the query?..

Answer / siri

suppose we want update ename in emp table using cursor....

declare crsorname cursor for
select * from emp
where dept='d005'
for update of ename....


upate emp
set ename=:ename
where current of cursor

Is This Answer Correct ?    0 Yes 0 No

can we update the table by using cursors can anyone post the query?..

Answer / mee

yes its possible

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More DB2 Interview Questions

Which component is responsible for processing sql statements and selecting access paths?

0 Answers  


What is sqlca?

0 Answers  


Explain the benefits you can get from mainframe connect?

0 Answers  


How do I copy a table in db2?

0 Answers  


I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.

0 Answers  


Name the different types of Table spaces.

5 Answers   IBM,


What is a thread?

3 Answers  


i hav created a program and moved to production but failed to create the table which is been used in the program. the program shows error as soon as it is moved or installed in production or shows error during its runtime. what is the sqlcode for this error

3 Answers   UST,


What is the maximum number of tables that can be stored on a Partitioned Table Space ?

1 Answers   IBM,


AGGREGATE function support by DB2. A) SUM & AVG B) SUM, MIN & AVG C) SUM, MAX, AVG , MIN &COUNT D) NONE

2 Answers   Accenture,


Which isolation level provides highest data integrity?

0 Answers  


where will u check for sqlcode ?

2 Answers   TCS,


Categories