Open GoogleCodeExporter opened 8 years ago
Yes, LIKE stetament doen't work at all. Only equal works correctly with strings
(field_name = 'someValue').
Latest version from Source tab.
Original comment by parampam...@gmail.com
on 5 Aug 2009 at 1:45
[deleted comment]
[deleted comment]
By now the LIKE statement theoretically works. But to use wildcards in
findByCriteria
you have to escape them with percent signs.
So "WHERE field_name LIKE '%something%'" would become "WHERE field_name LIKE
'%%something%%'".
If you are using a stringWithFormat for the criteria, you have to escape them
again,
so a complete call of findByCriteria would look like this:
NSString *searchText = @"john";
NSArray *results = [PersistentPerson findByCriteria:[NSString
stringWithFormat:@"WHERE name LIKE '%%%%%@%%%%'", searchText]];
Original comment by canbuffi@gmail.com
on 1 Feb 2010 at 7:53
I don't understand why it needs double escaping.
Original comment by mnemonic...@gmail.com
on 1 Feb 2010 at 7:59
Just use that double escaping without any questions!
Original comment by parampam...@gmail.com
on 1 Feb 2010 at 8:09
Original issue reported on code.google.com by
mnemonic...@gmail.com
on 19 Mar 2009 at 4:11