Hi Dude,this is Ram.could any one tell me aboue CURRENT OF
clause in DB2.
Thanks in advance.......

Answers were Sorted based on User's Feedback



Hi Dude,this is Ram.could any one tell me aboue CURRENT OF clause in DB2. Thanks in advance.........

Answer / narayana reddy

current of is using in cursors.
whenever we want to update and delete table data after retrived

Is This Answer Correct ?    4 Yes 0 No

Hi Dude,this is Ram.could any one tell me aboue CURRENT OF clause in DB2. Thanks in advance.........

Answer / kamlesh

Current of is used with cursors whenever v go for update in conjunction with for update of .
1.for update of in declare stmt
2.where current of in update query after fetching

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More DB2 Interview Questions

Hi All, In a Cobol-DB2 program, I am fetching rows from 4 tables using cursor and then based on the a field present in that table, It processes the information accordingly..for example stat-c is one digit field..if stat-c is 'D' then the a row is deleted from table and written those details in to a file. If the stat-c is 'U' then a row is updated (hardcoded what to update)in a table and written those details in to a file. If the stat-c is 'I' then a row is inserted in a table and written those details in to two files. The issue is i have to include the intermediate commits. When an abend occurs, due to commit statement db2 tables will be saved, But there will be lose of file contents. When we resubmitting the job associated with this program there will be insert ,update and delete anomolies to avoid that what measures could be taken?. The intermediate commit is nothing but issuing commit after massive inserts, updates and deletes(sum of 500actions)

1 Answers  


a cursor normally gets closed once we provide a commit . If u try to close the same cursor with close cursor command later after providing the commit will there be any sql-error.

3 Answers  


in the CURSOR declare statement, if i am using an where clause and trying to compare the value with a host-varialble. EXEC SQL DECLARE C1 CURSOR FOR SELECT DEPTNO, DEPTNAME, MGRNO FROM DEPARTMENT WHERE ADMRDEPT = :ADM-DEPT Where would i need to provide value to this host-variable in the where clause. how could i pass value to this host-variable to check it.

2 Answers   iGate,


could you give me an example how, where i code CHECKPOINT and restart...I need and example....thanks..

5 Answers  


I want to fetch the 10th row of a table which has been changed.How can I do it without going thru all the rows.

5 Answers  






What is a lock?

1 Answers  


What is the use of runstats in db2?

0 Answers  


What kind of database is db2?

0 Answers  


how can we find nth max salary from A table

5 Answers   IBM,


What is scrollable cursor in db2?

0 Answers  


by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?

4 Answers   Mphasis,


What techniques are used to retrieve data from more than one table in a single SQL statement?

2 Answers  


Categories