Re: Getting columns in DB order

[prev] [thread] [next] [Date index for 2005/06/14]

From: merlyn (Randal L. Schwartz)
Subject: Re: Getting columns in DB order
Date: 17:35 on 14 Jun 2005
>>>>> "Sam" == Sam Tregar <sam@xxxxxx.xxx> writes:

Sam> The problem is that this is demographic data, so the correct ordering
Sam> isn't alphabetical - it's the order of the columns in the DB
Sam> (firstname, lastname, address1, address2, city, state, country, ...).
Sam> Is there any way I can get this ordering without resorting to
Sam> hard-coding the columns in my table?

The "order" of columns in a table is supposed to be an implementation
detail, irrelevant to all well-written code.  Why do you care?  You're
not supposed to select "*", for example.  Just name the columns in the
order that you want them.

        -- 
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

(message missing)

Getting columns in DB order
Sam Tregar 17:06 on 14 Jun 2005

Re: Getting columns in DB order
merlyn (Randal L. Schwartz) 17:35 on 14 Jun 2005

Re: Getting columns in DB order
Sam Tregar 17:40 on 14 Jun 2005

Re: Getting columns in DB order
merlyn (Randal L. Schwartz) 17:46 on 14 Jun 2005

Re: Getting columns in DB order
Sam Tregar 17:49 on 14 Jun 2005

Re: Getting columns in DB order
David Baird 20:03 on 14 Jun 2005

Re: Getting columns in DB order
merlyn (Randal L. Schwartz) 17:47 on 14 Jun 2005

Re: Getting columns in DB order
merlyn (Randal L. Schwartz) 17:48 on 14 Jun 2005

Re: Getting columns in DB order
Charles Bailey 18:02 on 14 Jun 2005

Re: Getting columns in DB order
Sam Tregar 20:10 on 14 Jun 2005

Generated at 16:35 on 28 Jul 2005 by mariachi v0.52