in reply to Re^2: SQL: Update column(s) value with extra WHERE
in thread SQL: Update column(s) value with extra WHERE
$dbh->rollback(); die "update (and rolling back): ".$dbh->errstr;
Thanks Marshall for your insight and explanations. Blame me as that was actually my code :) Two points on this:
First, although I am aware and I think I understand the concept of grouping insert/updates for both performance and rollback benefits, I always have trouble to code that for particular DB (MySQL and SQLite are the two I use). The begin_work was complaining to me and so I commented it out as I saw (I think) some stack-overflow comment that this may be DB dependent.
Second, I disagree with dieing at any point in my programs and I look down on code which does that and forces me to try/catch/eval each of its calls instead of checking the error code that each function, IMO, should return (with reasonable exceptions of course). There has been a recent discussion of this here: Re^7: STDERR in Test Results and then here EyeBall stumps BodBall (Error Handling) and my input here Re^8: STDERR in Test Results (where I water down my vitriol so-to-speak).
So, yes, fine.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: SQL: Update column(s) value with extra WHERE
by Marshall (Canon) on Jul 18, 2023 at 06:32 UTC | |
Re^4: SQL: Update column(s) value with extra WHERE
by NERDVANA (Priest) on Jul 19, 2023 at 02:32 UTC | |
by eyepopslikeamosquito (Archbishop) on Jul 19, 2023 at 09:12 UTC | |
by bliako (Abbot) on Jul 19, 2023 at 07:26 UTC |