Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2016-12-07 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (125 votes). Check out past polls.