• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using 'Like' in 'sql' query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Using 'Like' in 'sql' query
      • From: Alan Ward <email@hidden>
    • Re: Using 'Like' in 'sql' query
      • From: Art Isbell <email@hidden>
  • Prev by Date: What MySql/Java type gives editable booleans in d2w?
  • Next by Date: Re: Using 'Like' in 'sql' query
  • Previous by thread: What MySql/Java type gives editable booleans in d2w?
  • Next by thread: Re: Using 'Like' in 'sql' query
  • Index(es):
    • Date
    • Thread