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
Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?
What is db2 stogroup?
What is the result of open cursor statement?
What do you mean by cursor?
What is with ur in db2?
What is universal database?
How does cobol compile db2 program?
What is a trigger in the db2 database?
Who uses db2?
What is meant by explain?
How do I start db2 in windows?
Explain the contention situations caused by locks?
What are the prerogatives?
Is db2 a mainframe database?
What is coalesce in db2?