in reply to Recoding a multi-sql-statement storedProc transaction in a script
Why do you think that's painful? The only difference is the eval wrapper and the following if. In any case you'd have to execute all forty statements -- either in your script or in your proc.
Now, the fact that you're using variables with number suffixes is a quick hint that you should be using an array instead. In other words, make an array of statement handles, prepare them, then:
Although I'm still not sure I understood what the pain you're referring to is.eval { $_->execute foreach @sth; }; if ($@) { $dbh->rollback; } else { $dbh->commit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Recoding a multi-sql-statement storedProc transaction in a script
by punkish (Priest) on Dec 14, 2004 at 23:33 UTC | |
by VSarkiss (Monsignor) on Dec 15, 2004 at 01:57 UTC | |
by punkish (Priest) on Dec 15, 2004 at 02:00 UTC |