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 ( #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 scrutinizing the Monastery: (7)
As of 2014-07-29 23:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls