in reply to error dbi

I really do need clarification on several implementation-specific points that seem to have been brought up here: (1) Is it "best practice" to call FINISH() every time? (2) Will there be resource-leaks if you do not completely consume a recordset, i.e. which would not occur if you did? (3) If a cursor variable goes out-of-scope, is FINISH() automatically called on it (if necessary)?

Replies are listed 'Best First'.
Re^2: error dbi
by erix (Prior) on Oct 20, 2020 at 09:59 UTC

    perldoc DBI:

    "finish" $rc = $sth->finish; Indicate that no more data will be fetched from this statement han +dle before it is either executed again or destroyed. You almost certai +nly do *not* need to call this method. Adding calls to "finish" after loop that fetches all rows is a com +mon mistake, don't do it, it can mask genuine problems like uncaught f +etch errors.