[Dbix-class] Use autoincremented value in other column

Rob Kinyon rob.kinyon at gmail.com
Thu Mar 26 14:56:37 GMT 2009


On Thu, Mar 26, 2009 at 10:48, David Schmidt <davewood at gmx.at> wrote:
> Hello everyone,
>
> Is there any way (without transactions or 2 DB trips) to achieve the following:
>
> Insert a row and use the autoincremented primary key value in another column.
>
> table: pictures
> id integer primary key,
> filename varchar2(128)
>
> my $picture = $c->model('myDB::Pictures')->new_result({
>                                           filename => <ID> . '_' . $filename
>                                });

If you weren't using DBIC, how would you solve this?

-- 
Thanks,
Rob Kinyon



More information about the DBIx-Class mailing list