Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: error dbi

by Fletch (Bishop)
on Oct 16, 2020 at 14:09 UTC ( [id://11122907]=note: print w/replies, xml ) Need Help??


in reply to Re^2: error dbi
in thread error dbi

o.O

  • prepare your statement to get a handle
  • execute to fetch results
  • call whatever fetch routines to retrieve all the results
  • WHEN YOU ARE DONE FETCHING RESULTS call finish on the handle

*plonk*

Edit: Obviously from the errors in the OP he's not fetching all the results from the queries and he's not scoping his handles such that they're destroyed before the DB handle is cleaned up, so he either needs to explicitly finish when he's not going to fetch anything more or properly scope the handles so they're cleaned up automagically as documented. Given the historical behavior of the source that's unlikely.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^4: error dbi
by choroba (Cardinal) on Oct 16, 2020 at 15:07 UTC
    DBI:

    > When all the data has been fetched from a SELECT statement, the driver will automatically call finish for you. So you should not call it explicitly except when you know that you've not fetched all the data from a statement handle and the handle won't be destroyed soon.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^4: error dbi
by bigup401 (Pilgrim) on Oct 16, 2020 at 15:10 UTC

    thanks its working now

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122907]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-24 07:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found