cursor with hold explain ?



cursor with hold explain ?..

Answer / ratheesh nellikkal

Hi All,
Cursor is nothing but a pointer to a result set that you
get as a result of executing a query.
So if u wanna some operations using this cursor then u have
to
1. Declare a cursor
2.Open the cursot before the first access
3.Do the operations
4.Close the cursor.

But in case of a normal cursor (not declared with 'with
hold' option) in between the operations if u issued a
commit command then the cursor will be getting closed and
if u wanna access it again then u should open it again.

But incase of a 'With hold' cursor it will maintane the
states if you issed a commit also.
Means it will not get closed by applying frequent commit.

Regards,
Ratheesh Nellikkal

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More DB2 Interview Questions

How to find the number of rows in db2 tables?

0 Answers  


What are foreign keys in db2?

0 Answers  


I have 1000 rows in a db2 table.I want to update first 100 records,How do I do it?

4 Answers   CTS,


in db2, already 10 columns arie der, and i want to insert 11th column. what parameters u wil consider for insertion and how will u insert

1 Answers   TCS,


How to check table size in db2 sap?

0 Answers  






Explain the contents that are a part of dclgen.

0 Answers  


Name the various locking levels available?

0 Answers  


What is the latest version of ibm db2?

0 Answers  


What is COPY PENDING status?

6 Answers  


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  


Why PS file called Physical seqential file?How to sore data in sequential file and ESDS file? What is the use of DBRM,PLAN,package and Collection.

1 Answers  


Before you give the explain statement, what are the prerogatives?

0 Answers  


Categories