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



I want to fetch the 10th row of a table which has been changed.How can I do it without going thru ..

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

I want to fetch the 10th row of a table which has been changed.How can I do it without going thru ..

Answer / divya,roshini,tiny

use scrollable cursor for fetching the 10th row

Is This Answer Correct ?    4 Yes 0 No

I want to fetch the 10th row of a table which has been changed.How can I do it without going thru ..

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

I want to fetch the 10th row of a table which has been changed.How can I do it without going thru ..

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

I want to fetch the 10th row of a table which has been changed.How can I do it without going thru ..

Answer / satish.klnm

exec sql
select * from table222 where count(*) > 9
end-exec.

Is This Answer Correct ?    0 Yes 14 No

Post New Answer

More DB2 Interview Questions

Is ibm db2 open source?

0 Answers  


I have a main program (A) where we delete some rows in table in a cursor, and we commit it in sub program(B). What will happen - will we get an error or not?

2 Answers  


What is the physical storage length of the data types: date, time, timestamp in the db2 database?

0 Answers  


If we have 100 records in the PF, we deleted all the records then what is the Size of the PF?

2 Answers  


What is the significance of the CURSOR WITH HOLD clause in a cursor declaration?

4 Answers  






What's the maximum number of characters that a tablename can have?

3 Answers  


what is diffrence b/w file-aid tool and file-aid utility???

1 Answers  


What is db2 isolation?

2 Answers  


What is an EXPLAIN in DB2. How and what is the steps followed in EXPLAIN command. Can all the queries be used in EXPLAIN command to check the performance.

3 Answers   IBM,


Give some example of statistics collected during RUNSTATS?

1 Answers  


What is meant by explain?

0 Answers  


Suppose I have a program which uses a dynamic SQL and it has been performing well till now. Off late, I find that the performance has deteriorated. What happened?

1 Answers  


Categories