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


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

Answers were Sorted based on User's Feedback



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

Answer / s

When you open the cursor the result set is built.

Is This Answer Correct ?    4 Yes 1 No

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

Answer / 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

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

Answer / m4io

It depends
If the cursor needs materialization then it gets executed
on "open cursor" like answer 1 and 2 say.

else
the query for the next row gets executed on each fetch.

Materialization happens f.e. when sorts are used.


You can close a cursor without having sqlcode +100.

Suppose a cics transaction reads a table (1.000.000 rows)
via an index : if only 20 rows are needed it will only
request 20 rows (1 each fetch) and then close the cursor.

In batch : if I get 100 pens and need to distribute them to
the people who requested some in order of date-requested, I
will close cursor as soon as 100 pens are distributed.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More DB2 Interview Questions

What is cloudant database?

0 Answers  


what is check point and restart Logic ? why do we go for that ??

2 Answers   CGI, UST, Xansa,


How do you do the EXPLAIN of a dynamic SQL statement?

2 Answers  


Can we declare DB2 HOST variable in COBOL COPY book?

2 Answers  


What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?

0 Answers  


Do we need cursor for Count(*)?

4 Answers   iGate,


How will you delete duplicate records from a table?

7 Answers   Google,


What is the maximum length of a column name in DB2? 18 or 30 or anything other than these?

4 Answers  


Generally if I want to select the names starting with c I need to use c% But how could I code to select the data which contains % as a part of data.

5 Answers  


If I have a view which is a join of two or more tables, can this view be updatable?

3 Answers  


What is db2?

0 Answers  


My sql statement select avg(salary) from emp yields inaccurate results. Why?

0 Answers  


Categories