Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The | character here means 'or' in SQL. So if the column here was called PROD_TITLE, the SQL where clause for above would be:FOO FOO|BAR|BAZ *TEST*|*BLUE*
To complicate things further I have a specific column for free search data, containing key/value pairs (like URL params):where PROD_TITLE = 'FOO' where PROD_TITLE in ('FOO','BAR','BAZ') where PROD_TITLE like '*TEST* or PROD_TITLE like '*BLUE'
I looked at SQL::Abstract::FromQuery but I don't have this data as a URL param. Is there a clever perl way I can use either SQL::Abstract or SQL::Abstract form to generate a SQL query catering for all where clauses?&BAZ=TEST &BAZ=*TEST* &ORDERDATE=20200101:2020130 &BAZ=TEST*&ORDERDATE=20200101:2020130
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Generate SQL Query, SQL::Abstract?
by haukex (Archbishop) on Mar 16, 2020 at 12:12 UTC | |
|
Re: Generate SQL Query, SQL::Abstract?
by choroba (Cardinal) on Mar 16, 2020 at 17:17 UTC |