Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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


Comment on Re: DBI execute() args in array format (or similar) possible?
Download Code

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: (5)
As of 2014-08-23 00:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (168 votes), past polls