|
From: Paul D. <pa...@sn...> - 2003-01-24 19:02:20
|
When you generate a statement handle for processing a statement,
is it intended that you invoke finish only when the statement
returns a result set, or also for statements such as INSERT, DELETE,
etc.
That is, which is these is better:
sth = dbh.prepare("INSERT ....")
sth.execute
sth.finish
or:
sth = dbh.prepare("INSERT ....")
sth.execute
# (no finish call here)
Also, in the Perl DBI, use of finish is discouraged if you fetch
all the rows of the result set, because it gets invoked for you and
is redundant. It's used when you don't fetch everything and need
to tell DBI explicitly to cancel. From my reading of the Ruby DBI
docs, I don't get quite this sense about finish. Is it deprecated
after a complete-fetch loop in the same way as for Perl?
|