Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: prepare insert statement outside while loop for speed

by McDarren (Abbot)
on Dec 02, 2010 at 05:19 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://874824]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-29 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found