in reply to DBI with ORDER BY

Perhaps your co-worker is referring to the "fetchall_hashref" method which essentially ends up creating a hash. Hence any sort order imposed by "ORDER BY" is lost.

Needless to say, if you are using "ORDER BY" do not use fetchall_hashref

Replies are listed 'Best First'.
Re^2: DBI with ORDER BY
by merlyn (Sage) on Mar 09, 2005 at 23:19 UTC
    Huh? The hashes are per-row. The rows still come out as a list or arrayref.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.


    update: Yup, I never use fetchall_hashref, and was confusing it with things that I use. Sorry. Too many similar sounding names.
      merlyn, I believe you're thinking of fetchrow_hashref and not fetchall_hashref. The latter does in fact retrieve all the results into a hash (a HoH), thereby effectively discarding any ordering an ORDER BY clause might have imposed.