[Dbix-class] DBIx how to update_or_create a table with primary index is autoincrement ? getting erroneous data

Rajeev Prasad rp.neuli at yahoo.com
Thu Sep 27 18:10:42 GMT 2012


for anyone's help in future...

creating a uniq constraint on a table field and using it in supplied field =
and key field (in update_or_create)=A0 resolved the issue. thank you Ronald=
 for input to cement my hunch.




________________________________
 From: Ronald J Kimball <rkimball at pangeamedia.com>
To: Rajeev Prasad <rp.neuli at yahoo.com> =

Cc: DBIx::Class user and developer list <dbix-class at lists.scsys.co.uk> =

Sent: Thursday, September 27, 2012 1:03 PM
Subject: Re: [Dbix-class] DBIx how to update_or_create a table with primary=
 index is autoincrement ? getting erroneous data
 =


Yes, that is correct. =A0For update_or_create() to work, it needs a way to =
find the original row, if it exists.

Ronald


On Thu, Sep 27, 2012 at 1:40 PM, Rajeev Prasad <rp.neuli at yahoo.com> wrote:

so far, I do not, but I want one filed to be uniq, lets call it field1. so =
should i set a uniq constraint on it, and then use that field in update_or_=
create? rather than the primary index?
>
>ty.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120927/ac7=
84500/attachment.htm


More information about the DBIx-Class mailing list