Ben Vinnerd wrote on 2009-05-15:
> Hey,
> 
> I have the following SQL to increment a field by 100:
> 
> update account set balance = balance + 100
> 
> I can increment a field with DBIC, like so:
> 
> $account->update({balance => \'balance + 100'});
> 
> Is there a better/cleaner way of doing this in DBIC?
> 
> Cheers,
> 
> Ben

Ben, how about this?

  $account->update({balance => $account->balance + 100});

-Byron


_______________________________________________
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/[email protected]

Reply via email to