Re: retrieving only specified fields ?

[prev] [thread] [next] [Date index for 2004/06/17]

From: "raptor
Subject: Re: retrieving only specified fields ?
Date: 15:00 on 17 Jun 2004
if we have the setup u mentioned then i want to say :

my @cd = CD->retrieve_all();

to retrieve only fields "title, year" instead of all  "cdid, artist, title, year"
for every row..
And which column to retriewe should be dynamic f.e. pseudo code :

my @cd = CD->retrieve_all(qw(title year));
my @cd = CD->retrieve_all(qw(cdid artist));
my @cd = CD->retrieve_all(qw(artist title));

the same thing for search, shearch_where etc....

> On Thu, Jun 17, 2004 at 02:45:30PM +0300, raptor@xxxxxx.xxx wrote:
> > To reiterate my question .... how to return only specified fields not all of them i.e. :
> > 
> > not : select * from blah
> > 
> > but : select field1, field2 from blah
> 
> I'm not sure what your are asking (in the context of Class::DBI). 
> 
> Using an example from the docs :
> 
>                package CD;
>                use base 'Music::DBI';
>                CD->table('cd');
>                CD->columns(All => qw/cdid artist title year/);
> 
> If you then make an instance, for example 'cdid' 123, i.e. :
> 
>   my $cd = CD->new(123);
> 
> .... you could think of that (for the purposes of illustration) as :
> 
>   SELECT cdid, artist, title, year FROM cd WHERE cdid = '123'
> 
> However the point is that you don't need to care about what the SQL is
> as Class::DBI handles that for you.
> 
> Please phrase your question in terms of the above example and we will be
> able to be more help.
> 
> Colm
> 

retrieving only specified fields ?
"raptor 11:45 on 17 Jun 2004

Re: retrieving only specified fields ?
colm-cdbi 12:23 on 17 Jun 2004

Re: retrieving only specified fields ?
"raptor 15:00 on 17 Jun 2004

Re: retrieving only specified fields ?
colm-cdbi 15:21 on 17 Jun 2004

Re: retrieving only specified fields ?
Simon Cozens 15:24 on 17 Jun 2004

Re: retrieving only specified fields ?
Tony Bowden 15:37 on 17 Jun 2004

Re: retrieving only specified fields ?
Heiko Klein 15:26 on 18 Jun 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52