[Dbix-class] Calling functions on UPDATE/INSERT?

Fayland Lam fayland at gmail.com
Sat Oct 14 02:34:31 CEST 2006


Cory Spencer wrote:
> Is it possible to call database functions/stored procedures on an UPDATE 
> or an INSERT statement?  I've found documentation describing how to do it 
> in a SELECT, but not the former two.
> 
> For example, on the MySQL database I'm currently using, I'd like to be 
> able to update a last_modified field with the return value from the NOW() 
> function.  How would one do this with DBIx::Class?

guess it is.

$rs->update( {
     last_modified => \"NOW()"
} );

> 
> Regards,
> 
> Cory Spencer
> 




More information about the Dbix-class mailing list