can we update the table by using cursors can anyone post
the query?
Answers were Sorted based on User's Feedback
Answer / bigben
yes you can
declare cursor using FOR UPDATE option
Is This Answer Correct ? | 23 Yes | 0 No |
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 |
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 |
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 |
what is the responsibility of the construction superintendent
What is the difference between Primary key and unique index?
How to resolve deadlock issue
What is explain plan in db2?
What is auditing?
What is the difference between drop table and delete table?
in a table consist of 1000 records among that i was updated 145 record how could i know that ..list of recently updated record's and where could i see those updated record's....pls help me out....
What is correlated subquery?
How to find last record before record through SQLRPGLE?
select * from orders where odate between '2010-01-01'and '2010-03-31' How do u fetch this into cursor?
Mention the various locks that are available in db2.
Mention the different locking levels that are available in db2.