Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Dancer::Plugin::Database::Core::Handle quick_select with where or condition

by RamiD (Acolyte)
on Sep 24, 2017 at 17:26 UTC ( [id://1200003]=perlquestion: print w/replies, xml ) Need Help??

RamiD has asked for the wisdom of the Perl Monks concerning the following question:

I am using perl Dancer::Plugin::Database::Core::Handle quick_select ,

in the where cluser , by default , every comma between the condition is like and

database->quick_select($table,   { foo => 'Bar', bar => 'Baz' });

Here the conditions is with and operator , foo should be qual to Bar and bar should be Baz

what about Or operand , how can I do quick_select with where Or operator

thanks Rami D.
  • Comment on Dancer::Plugin::Database::Core::Handle quick_select with where or condition
  • Download Code

Replies are listed 'Best First'.
Re: Dancer::Plugin::Database::Core::Handle quick_select with where or condition
by Corion (Patriarch) on Sep 24, 2017 at 17:53 UTC

    In my experience, all such "query tools" do is make you fight them. It's much better if you learn SQL and write your SQL directly.

    If you look at the section "WHERE clauses as hashrefs", you find how this flavour of query language is specified. It doesn't seem to allow for the "OR" operator, which is OK given its limited scope.

    But as database basically returns a DBI database handle, you can run your own SQL directly. If you use placeholders, you should be fine.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1200003]
Approved by davies
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-19 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found