when does the SQL statement gets executed when you use
cursor in the application programming ?

Answer Posted / mna

The process of using cursor is:
1. declare the cursor in working storage: You will write
the SQL query here
2. open the declared cursor : this is when the actual SQL
query is executed and the fetched rows are moved to the
cursor storage.
3. Fetch rows from cursor : Reading rows one by one on the
Cursor just like we read records from a sequential file
4. Close cursor : While fetching if we get an SQLCODE=+100
it is the end of the cursor just like we encounter eof
while reading records from a sequential file. Once this
condition is encountered we will close the cursor.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to fetch the last row from the table in SQL (db2)?

1292


What happens in bind step in a db2 program?

718


What is null indicator in db2?

823


How and when does the db2 enforces the unique key?

828


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

759


How do I import data from excel to db2?

804


In case if at some point of time db2 is down, would that impact the pre-compilation process of a db2-cobol program?

785


define clustering index.

793


Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?

2891


What is a cursor in programming?

802


List out the data types available.

904


What is access path in db2?

723


What is an instance database?

795


How to compare data between two tables in db2?

832


What do you mean by storage group (stogroup)?

753