Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: prepare insert statement outside while loop for speed

by McDarren (Abbot)
on Dec 02, 2010 at 05:19 UTC ( #874824=note: print w/replies, xml ) Need Help??


in reply to prepare insert statement outside while loop for speed

$sth->execute($data[0],$data[1],$data[2], $data[3], $data[4],$data[5])
The above could be written a bit more succinctly as:
$sth->execute(@data[0 .. 5])
See Slices

Or, if you know that @data will always contain just six elements, then just simply:

$sth->execute(@data)
Hope this helps,
Darren

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://874824]
help
Chatterbox?
and the leaves swirl about...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2016-12-08 01:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (133 votes). Check out past polls.