Re: Searching on an Attributes Substring
Jon Nolan <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
I see. You can still use 'like' or 'caseinsensitivelike' with the single character wildcard. To expand upon my earlier example and to retrieve the 3rd and 4th characters of a nine digit string:
new EOKeyValueQualifier("ssan", EOQualifier.QualifierOperatorLike, "??" + value + "?????");
Sorry if I'm still not getting it.
Jon
Jeff Dunnett wrote:
> Jon,
>
> Thanks for the advice but I suspect I wasn't clear enough. The problem
> with what you doing is that it assumes that I am searching for any
> instance of a substring in a string. What I am doing is looking at a
> specific field in a string. I have a string that is actually a nine
> digit number I want to look at the 3 and 4 digits in that string. In
> pure java I could look at this string like this:
>
> aString.substring(3,4)
>
> I was hoping there was a way to do something like that in without having
> to pull all the strings into memory.
>
> Regards,
> Jeff
>
> On 27-Feb-06, at 5:29 PM, Jon Nolan wrote:
>
>> Jeff,
>>
>> Not in fetch spec syntax but you'll get the idea.
>> new EOKeyValueQualifier("myStringAttribute",
>> EOQualifier.QualifierOperatorCaseInsensitiveLike, "*" + value + "*");
>>
>> Be sure your DB is up to the task though. It can get hairy depending
>> on a myriad of things.
>> Jon
>>
>>
>> Jeff Dunnett wrote:
>>> Hello,
>>> I know that most DBMS have the SUBSTRING function that allows you to
>>> search substrings. I have an attribute that is an NSString and would
>>> like to search on a substring of that attribute as part of a fetch
>>> specification. Is this possible using EOModeler or manually building
>>> the fetch specification? Is this possible or is using the SUBSTRING
>>> function in raw SQL the way to go?
>>> Regards,
>>> Jeff
>>> _______________________________________________
>>> WebObjects-dev mailing list
>>> [email protected]
>>> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
>
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
>