On Wed, 04 Feb 2015 08:22:21 +0100
OC <o...@ocs.cz> wrote:

> Hello there,
> 
> I've just bumped into a need to fetch based on a textual qualifier
> which I can't create. My records in one column contain tab-separated
> pairs of tags and text, like in
> 
> "foo:foo value<TAB>bar:blahblah<TAB>bax:this is the value of bax"
> 
> I need to fetch the rows whose value of given tag contains a string.
> 
> If it were "begins with", the solution would be a simple LIKE, but
> with "contains", the problem is that e.g., "LIKE '%foo%bax'" would
> select the sample row above, although the value for 'foo' is 'foo
> value' and does not contain 'bax' at all.
> 
> Is there some trick to do this at fetch with some smart qualifier (in
> FrontBase)? Or is there no better approach than to fetch all "LIKE
> '%foo%bax'" rows, and filter them further in memory e.g., using a
> regexp?
> 
> Thanks a lot,
> OC
> 

A few ideas.

MySQL has a regexp function that you can use in searches. Does
FrontBase also? If it is not too difficult to set up a qualifier using
that, it may work.

Also, it occurs to me that when I have had this problem, I sometimes
change the string to:

:foo:foo value<TAB>bar:blahblah<TAB>bax:this is the value of bax:

The the regexp becomes simpler. There are no edge cases for the first
and last key-value pair.

It is too bad you cannot break those tags up into a table for the tags
themselves. That would make it all much easier.

- ray
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to