[Dbix-class] Column Arithmatic

Michele Beltrame mb at cattlegrid.info
Mon Apr 30 16:14:53 GMT 2012


Hello!

> select colA * colB as product from tableC

$rs->search({
     # your conditions
}, {
     select => [ \'col1 * colb' ],
     as     => [ 'product' ],
});

Please be aware that you won't get an accessor on your row objects for 
"product", so you'll have to say:

$row->get_column('product');

to get the value.

Cheers,
Michele.

-- 
Michele Beltrame
http://www.italpro.net/ - mb at italpro.net
Skype: arthas77 - Twitter: _arthas



More information about the DBIx-Class mailing list