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

Fellows,

I'm pretty new on Class::DBI and because this i'm getting dumy questions on translation of my sql statments to Class::DBI.

Now I couldn't found any information on Class::DBI POD if can i set condition like '<' or '>' on search, and not use only '='.

Solli Moreira Honorio
Sao Paulo - Brazil

Replies are listed 'Best First'.
Re: Can i use condition on Class::DBI
by Arunbear (Prior) on Aug 30, 2005 at 15:19 UTC
      Thanks Arunbear, it's work well for me.

      Solli Moreira Honorio
      Sao Paulo - Brazil
Re: Can i use condition on Class::DBI
by davidrw (Prior) on Aug 30, 2005 at 15:53 UTC
    In the Class::DBI POD, under "DEFINING SQL STATEMENTS", there's a section about Class::DBI::AbstractSearch .. the example given is:
    my @music = Music::CD->search_where( artist => [ 'Ozzy', 'Kelly' ], status => { '!=', 'outdated' }, );
    That would do the search based on sql that looked like artist IN ('Ozzy', 'Kelly') AND status != 'outdated' (note that exact sql depends on config; e.g. it could be OR instead of AND if desired)
      Yes read this, but I wouldn't like to use Class::DBI::AbstractSearch, because this solution are using to much layer to access dabatase on my opinion.

      Thanks for your help anyway.

      Solli Moreira Honorio
      Sao Paulo - Brazil