Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The database column is named DocumentRef. I'm using $where rather than the %where way of doing things mentioned on the cpan page, because I'm trying to build this string up conditionally. The sql generated works perfectly unless it hits a field where I need to generate an 'in' clause. If someone could point me in the right direction I'd be really happy. Thanksif ( $DocumentReference ) { if( index($DocumentReference,"|") >= 0){ $DocumentReference =~ s/|/,/g; $where{DocumentRef}{'-in'} = ['$DocumentReference']; # also tried +=[$DocumentReference] }else{ $where{DocumentRef} = $DocumentReference; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: difficulty with SQL::Abstract '-in' clauses
by Your Mother (Archbishop) on Sep 17, 2009 at 22:22 UTC | |
by Anonymous Monk on Sep 20, 2009 at 09:47 UTC | |
by roboticus (Chancellor) on Sep 20, 2009 at 11:12 UTC | |
by Your Mother (Archbishop) on Sep 21, 2009 at 00:44 UTC |