[Dbix-class] Oracle Built-In Functions

Rob Kinyon rob.kinyon at gmail.com
Wed Aug 4 12:38:46 GMT 2010


2010/8/4 Андрей Костенко <andrey at kostenko.name>:
> $rs->date_updated( \‘SYSDATE’ );
>
> On Wed, Aug 4, 2010 at 1:25 PM, Duncan Garland
> <Duncan.Garland at motortrak.com> wrote:
>> Hi,
>>
>> I’m struggling to persuade DBIx::Class to use simple Oracle built-ins such
>> as SYSDATE, DECODE and NVL.
>>
>> Eg UPDATE table1 SET date_updated = SYSDATE, destination = NVL(
>> $destination, ‘home’ ) WHERE ... ;
>>
>> $rs->date_updated( ‘SYSDATE’ );

$schema->resultset('table1')->search({
...
})->update({
    date_updated => \'SYSDATE',
    destination => $destination // 'home', # Assumes Perl 5.10 or higher
});

No reason to call NVL when you're coming from Perl.

Rob



More information about the DBIx-Class mailing list