[Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

Jess Robinson castaway at desert-island.me.uk
Mon Sep 17 13:12:28 GMT 2007


Then you need to dig into SQL::Abstract further:

On Wed, 12 Sep 2007, Mark Lawrence wrote:

> UPDATE is another: What if I want the database to add the value of 1 to
> every row of a certain column? With SQLA all I have to play with is:
>
>    $SQLA->update(=FF=FFpeople=FF=FF, \%data);

->update('people', { col1 =3D> \'col1 +1'})

(or similar loop to do all the columns)

> As far as I know, there is no way to put the summation into \%data.
> Alternatively:
>
>    $SQLDB->query(
>        update =3D> [$person->age],
>        set    =3D> [$person->age->set($persion->age + 1)],
>    );
>

Anything that involves functions etc in sqla, just use a scalarref which =

interprets as "literal sql".

Jess


More information about the DBIx-Class mailing list