Re: Getting columns in DB order

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

From: Charles Bailey
Subject: Re: Getting columns in DB order
Date: 18:02 on 14 Jun 2005
--On June 14, 2005 1:06:46 PM -0400 Sam Tregar <sam@xxxxxx.xxx> wrote:

> Hello all.  I'm using Class::DBI::mysql to automatically create
> Class::DBI classes for my tables.  Now I'm working on writing routines
> to output my objects into CSV files and I'm having trouble getting the
> column ordering right.  Here's what I'm doing:

<pragmatic>
If you need your CDBI module to track the order of columns in the table so 
that it stays in sync with outside tools, it may be easiest to use set_sql 
and a parse the result of DESCRIBE, much like C:D:Mysql's set_up_table() 
does.  In fact, if you know you're going to need the information and want 
to keep it around, just override set_up_table() in you base class and store 
the order of columns as class metadata or in a package variable.
</pragmatic>

--
Regards,
Charles Bailey  < bailey _at_ newman _dot_ upenn _dot_ edu >
Newman Center at the University of Pennsylvania

(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