Hi , I am posting some interview ques .

what is the use of cursors ? what is the diff between
select and cursor ? bith are used for data retrival ..
rite?

Answer Posted / reddy

cursors are used to retrieve multiple rows . Cussors will
retrieve one row at a time and save the data in the
hostvariables.For retreiving the 2 nd row, we need to
repeat the loop.the same process is continued at the end of
data.

select stmt will retrieve multiple rows at a time. assume
that there are 10 rows in a table.
EX: EXEC SQL
SELECT empno , ename into :hvempno ,:hvename from emp;
END EXEC;

Here the above sql query reults all the 10 rows. But , the
host variables will hold only one row of data.the remaining
9 rows will not be stored any where.

hope this may help u

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If anyone has IBM Certification Dumps pls forward to me & also let me know what are the Certification Codes that are available in DB2

1576


Explain packages.

662


What is the default page size of buffer pools?

646


What is release/acquire in bind?

656


What is clone table?

590






What is a dbrm in db2?

576


Which component is responsible for db2 startup and shutdown?

628


can all users have the privilage to use the sql statement select * (dml)?

638


How to connect to db2 database from windows command line?

562


Can we insert update delete in view?

573


What are the prerogatives?

615


How to create db2 table in mainframe?

629


What is host variable in db2 cobol?

602


Define check constraint.

644


What does reorg do in db2?

576