in reply to SQL::Abstract not working right
Why would you want some default behaviour of the LIKE? If you look in the SQL::Abstract doc's you will find:
Which indicates that you need to provide your own wild-cards. The module will HELP you create complex SQL, but it doesn't do absolutely everyting for you. In time you may in fact be thanksful it works this way. I am :)But, this is probably not what you want in this case (look at it). So +the hashref can also contain multiple pairs, in which case it is expa +nded into an AND of its elements: my %where = ( user => 'nwiger', status => { '!=', 'completed', -not_like => 'pending%' } ); # Or more dynamically, like from a form $where{user} = 'nwiger'; $where{status}{'!='} = 'completed'; $where{status}{'-not_like'} = 'pending%'; # Both generate this $stmt = "WHERE user = ? AND status != ? AND status NOT LIKE ?"; @bind = ('nwiger', 'completed', 'pending%');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SQL::Abstract not working right
by data67 (Monk) on Oct 10, 2006 at 20:36 UTC |