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
How can we read records for specific member in CL? AND rpg?
What does db2 blu stand for?
How does cobol compile db2 program?
Explain how can you do the explain of a dynamic sql statement?
Are views updateable?
What is the difference between nvl and coalesce?
What is coalesce in db2?
Is db2 a programming language?
How does a cursor work?
Before you give the explain statement, what are the prerogatives?
What is bind in db2?
What is rebind in db2?
What is a plan and package in db2?
What is deadlock in db2?
What is copy pending and check pending in db2?