View previous topic :: View next topic
|
Author |
Message |
ami777us
New User
Joined: 06 Apr 2007 Posts: 33 Location: USA
|
|
|
|
A program inserted rows into a DB2 table in the order of the clustering index but when the rows are viewed in DB2 Fileaid utility, they donot appear to be in the order the rows were physically inserted by the application. Any ideas ?? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
they donot appear to be in the order the rows were physically inserted by the application. Any ideas ?? |
Why do you expect them to be? Physical sequence has little meaning in database data. . .
Possibly there is something i misunderstand. |
|
Back to top |
|
|
ami777us
New User
Joined: 06 Apr 2007 Posts: 33 Location: USA
|
|
|
|
It is more easily readable/understandable if rows are ordered in the sequence its inserted. The order is very important for the application and therefore validating the order will surely save us a lot of time. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
The order is very important for the application and therefore validating the order will surely save us a lot of time |
that' s why the select statement has the clause order by |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
The order is very important for the application and therefore validating the order will surely save us a lot of time. |
Hopefully, any and all application requirements can be met using ORDER BY.
Physical sequence of data should not be counted on. As the old IBM caveat says "the results may be unpredictable". If you do not use an order by in your select, you cannot depend on the sequence of the data returned.
If you test with small amounts of test data, you may successfully test only to have problems when there i more volume and rows are frequently inserted, updated, and deleted. |
|
Back to top |
|
|
|