Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by screamingeagle (Curate)
on Aug 12, 2002 at 19:49 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://189606]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-19 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found