I want to fetch the 10th row of a table which has been
changed.How can I do it without going thru all the rows.
Answers were Sorted based on User's Feedback
Answer / m4io
DECLARE cursor_name sensitivity SCROLL CURSOR FOR
SELECT ... FROM ...
FETCH ABSOLUTE 10 FROM cursor_name
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / divya,roshini,tiny
use scrollable cursor for fetching the 10th row
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / andyb
Why?
How do you know the one you want is still the 10th row ?
Other updates may have taken place.
If you know the key for the record you want then use that
Otherrwise unless the table has a sequential numeric key
then I think you have to go through the rows.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / nadeem
Use any one column name and its value of the 10th row to
fetch the 10th..for eg
select * from Table where deptno = 0010(any column name and
its value of 10 row)
Is This Answer Correct ? | 1 Yes | 5 No |
Answer / satish.klnm
exec sql
select * from table222 where count(*) > 9
end-exec.
Is This Answer Correct ? | 0 Yes | 14 No |
What is sqlca?
Q3. How will you fetch duplicate values from a DB2 table?
Mention the way of highlighting as well as putting a cursor to use in a cobol program.
What do you need to do before you do EXPLAIN ?
ther r 2 tables OTTABLE & SALTABLE, add the otamt from OTTABLE to empsal of SALTABLE if eid is matched else add the unmatched from OTTABLE to SALTABLE
Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....
What is the result of open cursor statement?
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.
what is commit & rollback? When and where is used while compiling a cobol-db2 program?
What is schema in db2?
What is temporal table in db2?
What are the disadvantages of using VARCHAR?