On 1/10/08 8:19 AM, James Masters wrote: > Have a bit of trouble with a Manager query. Trying to keep it short and > sweet, I am searching a table "orders" which has a onetoone relationship > called destaddress. The first 3 queries here work: > > push @query, ('custlastname' => {like => '%smith%'}); > push @query, ('destaddress.primecontact' => {like => '%smith%'}); > push @query, (or => ['custlastname' => {like => '%smith%'}]); > > but when the subtable query is put in the "OR" array viz: > > push @query, ('or' => ['destaddress.primecontact' => {like => '%smith%'}]); > > it fails with: > > Invalid query parameter: destaddress.primecontact at oprosemgord.pl line 991 > at C:/Perl/site/lib/Rose/DB/Object/QueryBuilder.pm line 132
Are you sure that "destaddress" appears in the with_objects or require_objects lists? One more thing: remember that "or" and "and" are prefix operators: or => [ A, B, C ] -> (A OR B OR C) and => [ A, B, C ] -> (A AND B AND C) So including just one thing in the "or" list doesn't really do anything: or => [ 'destaddress.primecontact' => { like => '%smith%' } ] is just: or => [ A ] which becomes: (A) which is the same thing as not including the "or" at all and just adding this directly to the query: 'destaddress.primecontact' => { like => '%smith%' } -John ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object