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
Can you use max on a char column?
Give the name of some fields form sqlca.
What do you mean by commit and rollback?
What is the connection string to connect to the DB2 Database ?
What is view db2?
What is bufferpool in db2?
What is the use of reorg in db2?
What is image copy in db2?
How to check table size in db2 sap?
Hello All, We have requirment to Replace BMC Db2 Load product thru CA FAST LOADPlus product. Do anyone have JCL to for FAST LOADPLUS and what all are thing need to take in consideration.
What's The Percentage Free Space ?
What are the benefits of using the db2 database?
Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?
How connect db2 database to datastage?
How can we retrieve the total number of records in RPG & CLLE?