Re: Trouble making set_sql work...

[prev] [thread] [next] [Date index for 2004/07/13]

From: colm-cdbi
Subject: Re: Trouble making set_sql work...
Date: 20:08 on 13 Jul 2004
On Tue, Jul 13, 2004 at 03:33:16PM -0400, Andy Harrison wrote:
> On Tue, 13 Jul 2004 19:38:06 +0100, colm-cdbi@xxxxxxxxx.xx.xx
> >   # in a nearby script :
> > 
> >   my $top_matches = Your::Class->get_top_matches($option, $limit);
> >   foreach my $result ( @$top_matches ) {
> >     my ($option_data, $count) = @$result;
> >     printf("%5d => %s\n", $count, $option_data);
> >   }
> 
> 
> Got that working, thanx.
> 
> But doesn't having to do the set_sql go against the spirit of
> Class::DBI anyway?  

No, not at all.  I didn't mean to toss around harmful phrases like 'in
the spirit of Class::DBI' :)

All I meant by that is that I was advocating (above) a way
to implement your request in terms of features in Class::DBI that are
designed for that purpose.  Using set_sql with a variable interpolated
from main:: is not a portable solution, having the functionality in a
class method seems like a good solution within the existing Class::DBI
framework.

> What's the proper thing to do in a situation like
> this where you might have to make a proprietary sql statement to get
> the results you need?

IMHO, if you need to do it then just go ahead and do it just bear in
mind that somebody will probably have wanted to do it before and will have
provided a way to make your life easier.

Colm

(message missing)

Trouble making set_sql work...
Andy Harrison 14:28 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 14:54 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 15:10 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 14:58 on 13 Jul 2004

Re: Trouble making set_sql work...
Jesse Sheidlower 15:04 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 16:36 on 13 Jul 2004

Re: Trouble making set_sql work...
John Beppu 16:46 on 13 Jul 2004

Re: Trouble making set_sql work...
Stuart Johnston 16:50 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 17:32 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 18:38 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 19:33 on 13 Jul 2004

Re: Trouble making set_sql work...
Drew Taylor 19:44 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 20:08 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 20:52 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 18:57 on 13 Jul 2004

Re: Trouble making set_sql work...
Jay Strauss 15:10 on 13 Jul 2004

Re: Trouble making set_sql work...
Perrin Harkins 17:51 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 18:23 on 13 Jul 2004

Re: Trouble making set_sql work...
Stuart Johnston 19:44 on 13 Jul 2004

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