Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: DBI with ORDER BY

by talexb (Chancellor)
on Mar 09, 2005 at 21:58 UTC ( [id://438073]=note: print w/replies, xml ) Need Help??


in reply to DBI with ORDER BY

    I heard from a coworker recently that when using SQL with an ORDER BY via DBI, you are not guaranteed to get your results back in the order you specified in your SQL.

Ridiculous.

DBI doesn't randomly edit or sort the results coming back from the database. It's just an abstraction layer. It is given an SQL command, it executes it and returns the result.

But, in the interest of science (and in the event I really don't know what I'm talking about), does your co-worker has an example showing this bizarre behaviour?

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re^2: DBI with ORDER BY
by YoungPups (Beadle) on Mar 09, 2005 at 22:08 UTC

    I figured as much and was going to ask him for an example, or at least documentation of this behavior somewhere. I've only heard him explain this to other coworkers, which is why I wonder if I might have just heard him wrong. He's doing a code review for me sometime in the next few days, and I expect to have him bring this up with me then.

    I was planning on disagreeing with him on this, but other than this he's the coder around here I most trust, so I wanted some backup before I pick a fight.
        I was planning on disagreeing with him on this, but other than this he's the coder around here I most trust, so I wanted some backup before I pick a fight.

      They have a wonderful saying in Texas that goes something like this: "Be sure your words are soft and sweet, just in case you are forced to eat them" ;)

      I find that what works better than 'picking a fight' is a somewhat surprised disbelief that the situation is as the code reviewer describes. Think about it -- what advantage is there to using DBI if it sometimes messes with the ordering of the data? That doesn't sound like a feature to me, it sounds more like a bug.

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://438073]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2024-03-28 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found