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

Re: Perl script to check database works or does it?

by tangent (Parson)
on Jan 04, 2016 at 21:17 UTC ( [id://1151880]=note: print w/replies, xml ) Need Help??


in reply to Perl script to check database works or does it?

You call the finish() method on the statement handler within both your loops:
while($ref = $sth1->fetchrow_hashref) { print FHExtract join (", ", values %$ref), "\n"; # Closing the statement handler $sth1->finish; } and while($ref1 = $sth2->fetchrow_hashref) { print FHExtract join (", ", values %$ref1), "\n"; # Closing the statement handler $sth2->finish; }
You need to move those calls outside the loop, or rather, as the docs recommend, don't use them at all - the statement handler going out of context does the same thing.

Replies are listed 'Best First'.
Re^2: Perl script to check database works or does it?
by chris01010 (Novice) on Jan 05, 2016 at 10:34 UTC

    Thank you. Didn't even know those docs existed!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found