home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.sybase
- Path: sparky!uunet!csfb1!lhall
- From: lhall@csfb1.fir.fbc.com (Lawrence Hall)
- Subject: RE: Order of record when inserting
- Message-ID: <Bxx2G3.I5w@csfb1.fir.fbc.com>
- Sender: news@csfb1.fir.fbc.com (Usenet News Account)
- Reply-To: uunet!csfb1!lhall
- Organization: First Boston Corporation
- Date: Wed, 18 Nov 1992 14:48:03 GMT
- Lines: 42
-
- Kevin Dombroski writes :
-
- [ Is there any guarantee of the order of records after doing several inserts
- [ to table, and then doing a "select *" from the table (ie., no "order by")?
- [ I've always understood that there can be no guarantee, but I can't find any-
- [ thing in the manuals to support/dispute this, and I'm waiting for a call back
- [ from Sybase Tech Support. For some reason, I feel like I'll get the answer here
- [ faster...
- [
- [ I'm dealing with data coming from an IBM mainframe, and the arrangement of
- [ the returned data must be preserved (I know, I know...at least it's not a
- [ punch card system :-). After stuffing it into a temp table, it doesn't
- [ appear to preserve the order. Is there some way this can be accomplished?
- [
- [ KevinD
- [
-
- I have found that the order seems to be preserved when using Fast BCP to insert
- data, but not always on inserts or Slow BCP's. However - I prefer that users
- at our site do not rely on the order of records since there is no guarantee of
- the order. If the records come back in a certain order, and the application
- rely's on this, then the app will have problems if the clustered index is
- changed, if the data is unloaded and re-loaded or when we change DBMS versions.
-
- I tell our programmers to use an ORDER BY whenever they need a specific order.
- In the case you speak of, it might be necessary to use a timestamp column on
- the table and use that for the ORDER BY.
-
- The only time that we rely on the order of inserted records is when we are
- doing a fast BCP of a large table and want to use the 'with sorted data' option
- when creating the clustered index.
-
- " " " Lawrence
-
-
- ----------------------------------------------------------------------------
- Lawrence E. Hall
- First Boston Corp.
- 5 World Trade Center 9th Floor uunet!csfb1!phantom!lhall
- NYC, NY 10048 lhall@csfb1.fir.fbc.com
- ----------------------------------------------------------------------------
- The Secretary will disavow all knowledge.
-