AW: [Dbix-class] using distinct and literal SQL in select list does not work

Hartmaier Alexander Alexander.Hartmaier at t-systems.at
Wed Oct 15 22:42:43 BST 2008


And again confusion because dbic's as doesn't do a sql as...
dbic's as is to name the column for a $row->get_column('your_colname_specif=
ied_by_as') call, it doesn't insert 'as' into the sql query.
To do that look at the dbic docs.

-Alex

________________________________
Von: BUCHMULLER Norbert [norbi.lists at nix.hu]
Gesendet: Mittwoch, 15. Oktober 2008 14:58
An: dbix-class at lists.scsys.co.uk
Betreff: Re: [Dbix-class] using distinct and literal SQL in select list doe=
s not work

On Tue, 14 Oct 2008 12:09:52 -0700 Marc Mims <marc at questright.com> wrote:

> Are you sure you need the "as" alias for the order by?  The example you
> gave to demonstrate the problem is perhaps too trivial.

Yeah, I tried to limit it to the bare bones necessary to reproduce the
problem. :-)

In the scenario I have there's a method (of a custom resultset object)
that takes a resultset ($self) and returns a resultset. The users of this
method need not know about the details, they just use the returned
resultset in further search() calls and simply use the additional column
added by the method. Even in an 'order_by' attribute. It would be very
inconvenient if I had to pass the SQL string used to construct the extra
column.. (And the method not only adds this column, but adds conditions
to the resultset, so simply moving the code that generates the extra
column into a function is not enough here.)

Now, the above setup works fine - up to the point when I use 'distinct'
in a search(). (In fact, there's another problem with it, using '+select'
on the resultset clears the previous columns added by '+select' - see the
other thread I started.)

norbi

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co=
.uk


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*
Notice: This e-mail contains information that is confidential and may be pr=
ivileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20081015/dba=
bd159/attachment.htm


More information about the DBIx-Class mailing list