home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!emory!sol.ctr.columbia.edu!spool.mu.edu!sdd.hp.com!elroy.jpl.nasa.gov!ames!sun-barr!cs.utexas.edu!bcm!mparsons
- From: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
- Newsgroups: comp.databases.sybase
- Subject: Re: Order of records when inserting
- Date: 18 Nov 1992 14:50:48 GMT
- Organization: Baylor College of Medicine, Houston, Tx
- Lines: 29
- Distribution: usa
- Message-ID: <1edl89INNshd@gazette.bcm.tmc.edu>
- References: <1992Nov17.185704.9484@ctp.com>
- Reply-To: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
- NNTP-Posting-Host: fleming.csc.bcm.tmc.edu
- Originator: mparsons@fleming.csc.bcm.tmc.edu
-
-
- In article <1992Nov17.185704.9484@ctp.com>, kdomb@ctp.com (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?
-
- A couple quick tests seem to indicate that the index used to pull your
- data designates the return order(assuming, of course, that you are
- not giving an 'order by' clause). If the clustered index is used, your
- data comes back ordered by the clustered index. If another index is
- used the data comes back ordered that way . . .
-
- As for the temp table . . . assuming my 'findings' are correct . . you
- could put an index on the temp table that would order the info the
- way you want it.
-
- Hey! What'dya expect for $0.02??!! ;-)
-
- Mark
-
-