home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / sybase / 342 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  1.9 KB

  1. 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
  2. From: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
  3. Newsgroups: comp.databases.sybase
  4. Subject: Re: Order of records when inserting
  5. Date: 18 Nov 1992 14:50:48 GMT
  6. Organization: Baylor College of Medicine, Houston, Tx
  7. Lines: 29
  8. Distribution: usa
  9. Message-ID: <1edl89INNshd@gazette.bcm.tmc.edu>
  10. References: <1992Nov17.185704.9484@ctp.com>
  11. Reply-To: mparsons@fleming.csc.bcm.tmc.edu (Mark Parsons)
  12. NNTP-Posting-Host: fleming.csc.bcm.tmc.edu
  13. Originator: mparsons@fleming.csc.bcm.tmc.edu
  14.  
  15.  
  16. In article <1992Nov17.185704.9484@ctp.com>, kdomb@ctp.com (Kevin Dombroski) writes:
  17. |> 
  18. |> Is there any guarantee of the order of records after doing several inserts
  19. |> to table, and then doing a "select *" from the table (ie., no "order by")?
  20. |> I've always understood that there can be no guarantee, but I can't find any-
  21. |> thing in the manuals to support/dispute this, and I'm waiting for a call back
  22. |> from Sybase Tech Support. For some reason, I feel like I'll get the answer here
  23. |> faster...
  24. |>                 
  25. |> I'm dealing with data coming from an IBM mainframe, and the arrangement of
  26. |> the returned data must be preserved (I know, I know...at least it's not a
  27. |> punch card system :-). After stuffing it into a temp table, it doesn't
  28. |> appear to preserve the order. Is there some way this can be accomplished?
  29.  
  30. A couple quick tests seem to indicate that the index used to pull your
  31. data designates the return order(assuming, of course, that you are 
  32. not giving an 'order by' clause).  If the clustered index is used, your
  33. data comes back ordered by the clustered index.  If another index is
  34. used the data comes back ordered that way . . . 
  35.  
  36. As for the temp table . . . assuming my 'findings' are correct . . you
  37. could put an index on the temp table that would order the info the 
  38. way you want it.
  39.  
  40. Hey! What'dya expect for $0.02??!! ;-)
  41.  
  42. Mark
  43.  
  44.