Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Get a hash object from a database with DBI for use with HTML::Template

by dug (Chaplain)
on Aug 04, 2002 at 23:19 UTC ( #187550=note: print w/ replies, xml ) Need Help??


in reply to Get a hash object from a database with DBI for use with HTML::Template

  Warning: this reads the entire data set into memory, so be careful not to read huge amounts of data.

You can avoid this by creating other problems :)
Inside of get_hash(),

my $sth = $dbhandle->prepare( $stmt );
can become
my $sth = $dbhandle->prepare( $stmt, {"mysql_use_result" => 1} );
This will block other processes, and you will need to roll throught the complete dataset with fetchall_* or fetchrow_* and friends to avoid future errors on the handle unless you want to set up a brand new database for each query. It does seem to make sense some places, however.

  dug


Comment on Re: Get a hash object from a database with DBI for use with HTML::Template
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2015-08-01 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls