Using 'Like' in 'sql' query
Using 'Like' in 'sql' query
- Subject: Using 'Like' in 'sql' query
- From: "Riaz Lalehzari" <email@hidden>
- Date: Fri, 11 Apr 2003 03:08:13 +0000
Hello,
I tried searching the archives for posts on using 'like' in 'sql' queries
but the search engine says "ignored: like sql No matches." HAHA.
Basically, I already have used 'like' in my EOModeler fetch specifications
with no problems. But now that I am using it in a variable sql string, it
doesn't seem to work (ie. only returns exact matches). This is an example of
what I do:
String sqlQuery;
sqlQuery = "SELECT firstname FROM Person WHERE firstname like '" +
enteredFirstName + "'"
Then I say - results = EOUtilities.rawRowsForSQL(....);
I've tried manually coding the '*' wildcard and '?' on the ends of the
string, inside and outside the ' symbols. If I enter "Ken*" as my
enteredFirstName it still should work though. But it seems to be looking for
people with the name "Ken*" instead of using a wildcard.
Regards,
Riaz
_________________________________________________________________
Hotmail now available on Australian mobile phones. Go to
http://ninemsn.com.au/mobilecentral/hotmail_mobile.asp
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.