View previous topic :: View next topic |
Author |
Message |
manojvoona Beginner
Joined: 05 Jan 2006 Posts: 43 Topics: 14
|
Posted: Fri Jan 13, 2006 7:07 am Post subject: sequencial read a database records |
|
|
Hi,
My requirement is to read all the records sequencial. The Primary key is not a sequencial number and so we can not incorporate a logic to fetch one after the othe.
Is there a feild in DB2 like row ID, which is a unique incremental number by which we can fetch one after the other.
It would be of great help.
Thanks
Manoj Voona |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Jan 13, 2006 8:09 am Post subject: |
|
|
manojvoona,
What exactly do you mean sequential? DB2 does NOT gurantee that if you load the records the sequentially , they will be stored sequentially. Db2 finds the first available page and stores the records. So if you want to maintain sequence then you need add the ROWID column to your table.
Hope this helps..
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
manojvoona Beginner
Joined: 05 Jan 2006 Posts: 43 Topics: 14
|
Posted: Mon Jan 16, 2006 4:12 am Post subject: |
|
|
Thanks a lot.
Manoj Voona |
|
Back to top |
|
|
manojvoona Beginner
Joined: 05 Jan 2006 Posts: 43 Topics: 14
|
Posted: Mon Jan 16, 2006 4:15 am Post subject: |
|
|
Hi Kolusu,
What is the maximum number of records that a cursor can accomedate.
thanks
Manoj Voona |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Jan 16, 2006 6:16 am Post subject: |
|
|
Quote: |
What is the maximum number of records that a cursor can accomedate.
|
manojvoona,
There is no limit for the cursor. However it is suggested that you use OPTIMIZE clause on the cursor declaration.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
manojvoona Beginner
Joined: 05 Jan 2006 Posts: 43 Topics: 14
|
Posted: Tue Jan 17, 2006 9:22 am Post subject: |
|
|
thanks a lot |
|
Back to top |
|
|
|
|