would this option return the fifth row of the table.
Looks like it will, try it out.
If u give me an example containing both declaring and fetching cursor then that would be best.
Links provided in previous post also have examples, just scroll down to the end of manual.
Also tell me that can we fetch any row using indexes?
If a table has index, Db2 will always try to use the index.
If a table has multiple indexes, Db2 optimizer will again try to use fastest path to access data. We need to make sure that Runstats,Reorg and Rebind are schedule to run depending to activity on table. Runstats keeps stats on table accurate and helps optimizer determine best/fastest path to data.
Probably good SQL coding practive would be to code the WHERE clause of SQL to have indexed column with '=' first, then index columns with >,<, or Between next, then non-indexed column's with '=' and non-indexed columns with <,> , Between etc.
To get any idea filtering and access path SQL would take, execute EXPLAIN or Enhanced Explain on SQL.