[Dbix-class] DBIX, row update problem

Rajeev Prasad rp.neuli at yahoo.com
Thu Oct 4 00:22:44 GMT 2012



I am only intending to update a column in a row based on 'item' value. Item=
 value is unique constraint column.


DBIx code:

=A0=A0=A0 $schema->resultset('Itemlist')->update(
=A0=A0=A0 {
=A0=A0=A0 =A0=A0=A0 item =3D> $item,
=A0=A0=A0 =A0=A0=A0 item_comment =3D> $mycomments
=A0=A0=A0 },
=A0=A0=A0 {key =3D>'item'}=A0=A0=A0 #uniq constraint on item
=A0=A0=A0 );


when i look in table row it is updated!!! but i get this err in apache log =
and throws a 500 http error. (pl script dies)


generates this error in apache log:

table name itemlist


=A0DBIx::Class::ResultSet::update(): DBI Exception: DBD::mysql::st execute =
failed: Duplicate entry 'item1' for key 'item' [for Statement "UPDATE iteml=
ist SET item =3D ?, item_comment =3D ?" with ParamValues: 0=3D'bigitem', 1=
=3D'test comment'] at xxxyyy.pl line 60, referer: http://xxxyyyzzz....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20121003/d95=
dd818/attachment.htm


More information about the DBIx-Class mailing list