in reply to Update Primary Key with DBIx::Class
Hi, your problem can be solved by using either of:
... see the doc for discard_changes(), which has a somewhat counter-intuitive name but acts as a "commit" if you've made changes to your result object in your code.if($acct) { $acct->acctid( 'pv002' ); $acct->update; $acct->discard_changes; # add this }
Or else:
... which updates the record in the database immediately as well as in your program.if($acct) { $acct->update({acctid => 'pv002'}); }
To find out what queries DBIx::Class is sending to your database, run your program with DBIC_TRACE=1 set in your environment.
Hope this helps!
Update: fixed missing clsoing brace, thanks pryrt
|
|---|