Select empno, sal from emptbl where empno < 101.By this
query can we fetch first 100 recs? where empno is primary
key.It won't throw -811 error? if it wont,then what is use
of cursor technique while fetching first 100 recs.


Please need more clarification.

Answer Posted / kingmanish

Yes this query will fetch multiple records.

If tried to fetch these records in variables in a sql query
it will give -811 error.

In order to be able to handle these multiple records we
have to use cursor.

Now using cursor we can process each of these records one
at a time and thus cursors come handu here.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between nvl and coalesce?

604


What action db2 takes when a program aborts in the middle of a transaction?

659


How to access db2 tables in mainframe?

615


What is runstats db2?

585


Is the primary key a clustered index?

612






What is buffer pool?

614


Mention the various locks that are available in db2.

617


How do I connect my db2 database to ibm?

603


How to restart a DB2 program?

1367


SQLCODE = -199, ERROR: ILLEGAL USE OF KEYWORD CHAR, TOKEN KEY was expected

10777


When reorg is used?

678


What is db2 connect?

609


How do I import a csv file into db2?

562


How to rename a table in DB2 ?

641


What are host variables in db2?

628