Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: DBI execute() args in array format (or similar) possible?

by screamingeagle (Curate)
on Aug 12, 2002 at 19:49 UTC ( #189606=note: print w/ replies, xml ) Need Help??


in reply to DBI execute() args in array format (or similar) possible?

In your specific case, instead of using placeholders, you could try building the SQL SELECT stmt based on the number of arguments present. For example,
$sql = "select clli, traffic_date, count(distinct(traffic_hour)) from gvc_traffic30 where 1=1 "; $sql .= " and traffic_Date in ($date_ref_args) " if ( $date_ref_args ) +; ...etc...
The "1=1" part enables you to add a dynamic number of "And " clauses without any problems...
hth

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2016-06-29 16:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (385 votes). Check out past polls.