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?

Answers were Sorted based on User's Feedback



Hi , I am posting some interview ques . what is the use of cursors ? what is the diff between s..

Answer / yuvaevergreen

>>Cursors are memory structures used to handle multiple
rows at a time.
>>Though,select statement can fetch only multiple rows, we
cannot handle multiple rows using host variables.
Basic difference would be single row handling and multiple
rows handling.

Is This Answer Correct ?    6 Yes 0 No

Hi , I am posting some interview ques . what is the use of cursors ? what is the diff between s..

Answer / 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

More DB2 Interview Questions

can you use symbolic parameters in JOB?

5 Answers   IBM,


How many databases can be created inside an instance in db2 ?

0 Answers   MCN Solutions,


How to resolve -805 error in DB2?

1 Answers   Cap Gemini,


What is dbrm in db2 database?

0 Answers  


What is the use of DELGEN in DB2? Can we Write the program with out using it?

6 Answers   Cap Gemini,






What is multi row fetch in db2?

0 Answers  


How to insert more than one record using insert?

7 Answers   Atos Origin, IBM,


Q1. How will you use two different DB2 qualifiers in a single COBOL program? Suppose we have 2 tables EMP1 and EMP2 with same structure defined in two different DB2 qualifiers QUAL1.EMP1 and QUAL2.EMP2 now during first 15 days we want to use QUAL1.EMP1 and rest of the days QUAL2.EMP2  how will we do this.  We can create a single program and a single load for this program. 

2 Answers   RBS,


How we create a tables in DB2 ?Previously client has using 7 letters for user id,now he wants to increase the letters from 7 to 12 for user id.How we can do it?

6 Answers   Wipro,


When will you chose to run RUNSTATS?

1 Answers  


What are simple, segmented and partitioned table spaces ?

1 Answers   TCS,


What is query_cache_limit?

0 Answers  


Categories