[Dbix-class] Re: how to use a complex query in DBIx::Class

A. Pagaltzis pagaltzis at gmx.de
Sat Dec 30 08:41:01 GMT 2006


* Jess Robinson <castaway at desert-island.demon.co.uk> [2006-12-30 03:35]:
> I was referring to the IS NOT NULL in the SELECT part of the
> query.. I dont see what its doing / supposed to do at all. Care
> to explain what that is doing?

It simply specifies a computed column with the result of a
boolean expression to return from the SELECT. That was what
I meant by my example. Much as you can say

    SELECT id, price * 1.19 AS price_incl_vat FROM products

you can equally say

    SELECT id, price IS NOT NULL AS in_stock FROM products

In the first case you get a column or numbers reflecting the
consumer price of the products, in the second you simply get a
column of boolean values reflecting whether whether the product
has ever been in stock.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Dbix-class mailing list