Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^2: Simplifying queries in DBI

by neilwatson (Curate)
on Mar 15, 2014 at 15:37 UTC ( #1078450=note: print w/ replies, xml ) Need Help??

in reply to Re: Simplifying queries in DBI
in thread Simplifying queries in DBI

I was hoping to use place holders, but I don't see any way for the place holders to also contain the text beyond the values. At best I can run a loop to build the string for all the LIKE bits, but it doesn't seem to offer a good gain.


if ( $query{hostname} ) { $query = $query . " AND host_name LIKE '$query{hostname}' ESCAPE +'!'"; } if ( $query{ip_address} ) { $query = $query . " AND ip_address LIKE '$query{ip_address}' ESCA +PE '!'"; } # etc...

Neil Watson

Comment on Re^2: Simplifying queries in DBI
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2015-11-29 17:22 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (751 votes), past polls