how to fetch multiple records without using cursor
Answers were Sorted based on User's Feedback
Answer / mahi
I think it can be done with the help of arrays or Tables(in
cobol)
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / krishna reddy
we must know max no of records we want to fetch.
suppose max no record 50...
01 host-variable.
02 employee occurs 50 times.
05 eno pic 9(4).
05 ename pic A(20).
05 esal pic 9(5).
Declare cursor c1 for select eno,ename,esal from emp;
open c1.
fetch c1 into :host-variable.
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / anto
The question is to fetch multiple records...not multiple
row(s)..
So this is possible with single select query.
| Is This Answer Correct ? | 0 Yes | 1 No |
What is the SQL query to select, delete and get count of duplicate rows in DB2?
database DSNDB01 means a.db2 catalog b.db2 directory c.BSDS d.active logs answer with reason please
What are the prerogatives?
Why PS file called Physical seqential file?How to sore data in sequential file and ESDS file? What is the use of DBRM,PLAN,package and Collection.
what is the difference between join and union?
How to define the data items to receive the fetch items for the SQL?
What is a composite index and how does it differ from a multiple index?
What is subquery ?
How to see the structure of db2 table??
if suppose i am having an ACCOUNT table with 3 coloumns ACC. NO,ACC. NAME,ACC. AMOUNT . If a unique index is also defined on ACC.NO and ACC.NAME then write a query to retrieve account holders records who have more than 1 ACC.
can I alter a table (e.g. adding a column) when other user is selecting some columns or updating some columns from the same table?
how to unload different table data into different gdg files/ vsam files.