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 |
My sql statement select avg(salary) from emp yields inaccurate results. Why?
db2 query I have one table with the following details. SNO SNAME DOJ ------ -------------------- ---------- 10 KRISH 2007-03-19 20 REDDY 2007-05-19 30 RRRRR 2007-05-19 40 BBBBB 2008-05-19 50 CCCCC 2009-05-19 60 JJJJJ 2009-05-19 70 JJJJJ 2004-05-19 i want the output in the following format:( no of students joined in each year(no nedd to consider about month and date) year count --------- ---------- 2004 1 2007 3 2008 1 2009 2
Outputs of explain are with matchcols = 0. What does this signify?
what is the Foreign key? explain?
In my table having 100 Rec. How can I delete the 7th row?? (we don't know what is data inside the table)
Explain package in db2 and its advantages?
Is it possible using max on a char column?
What do you mean by rollback?
what is the process of precompiler?
What is a composite index and how does it differ from a multiple index?
What are the 4 environments which can access DB2 ?
What can the SET option of the Repair Utility accomplish?