• 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
Re: creating my EOQualifier in code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating my EOQualifier in code


  • Subject: Re: creating my EOQualifier in code
  • From: Asa Hardcastle <email@hidden>
  • Date: Sun, 24 Feb 2008 07:28:59 -0500

Hi Ted,

In FrontBase CaseInsensitiveLike stopped working for us a few years ago. Here is what we do:


1. set the CASE_INSENSITIVE collation at the field level in the database

2. use * in the qualifier argument (which must be translated to '%' by the adapter)


<snip>
args = new NSArray(new Object[] { "*"+aPartialLasName+"*" , isComplete});
q = EOQualifier.qualifierWithQualifierAndForma("lastName like %@ AND isComplete = %@", args);
</snip>


The code snippet above would act like a contains, if you placed the wildcard on one side or the other, you would have a beginswith/ endswith equivalent.

Keep in mind, this is with FrontBase.  What DB are you using?

asa


On Feb 24, 2008, at 5:36 AM, Theodore Petrosky wrote:

Thanks, but I seem to have a problem with the variable
in the expression:

EOQualifier newQual =
EOQualifier.qualifierWithQualifierFormat("(client
caseInsensitiveLike %@) AND (isComplete = 0)", arg1);

if I put the trailing '%' as a wildcard the
expressions fails with:

Reason:	 Lexical error at line 1, column 32.
Encountered: ")" (41), after : "%"

my sql example... we answered the case insensitivity
but not the wildcard....

select * from adlist where lower(client) like
lower('s%')

maybe I need to escape the trailing %....

Ted




--- David Elliott <email@hidden> wrote:

Theodore,

Try the "caseInsensitiveLike" selector instead of
the "like" selector.

-Dave

On Feb 24, 2008, at 1:07 AM, Theodore Petrosky
wrote:

I don't get this.. I am following the example in
the
Marker book (pg 230).

EOQualifier newQual =
EOQualifier.qualifierWithQualifierFormat("(client
like
%@) AND (isComplete = 0)", arg1);
EOFetchSpecification fs = new EOFetchSpecification
("AsAdSched", newQual, null);

This is working fine... I get the resultant data I
expect... I am trying to figure out the 'like' and
escape for pattern matching...

what i want in the SQL is:

select * from adlist where lower(client) like
lower('s%')

it will not matter whether you type upper nor
lower
case....

Ted







____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@zenn.net


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: creating my EOQualifier in code
      • From: Asa Hardcastle <email@hidden>
References: 
 >Re: creating my EOQualifier in code (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: creating my EOQualifier in code
  • Next by Date: Re: creating my EOQualifier in code
  • Previous by thread: Re: creating my EOQualifier in code
  • Next by thread: Re: creating my EOQualifier in code
  • Index(es):
    • Date
    • Thread