× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks all for your helpful replies, that looks a lot cleaner.

A quick addition - I'm struggling to see how I could use static SQL and
Case Statement with the following:

If Filter1 <> *Blanks;
SqlWhere += ' And RegExp_Like(Field1, ''' + Filter1 + ''',1,''i'') ';
EndIf;

In this particular case (where I'm really using the regular expression for
a case insensitive search) I recall from something Birgitta posted that
instead of using a regular expression, I could instead:

set option srtSeq = *LangIdShr;

And use a regular LIKE predicate:

E.g something along the lines of:

Exec Sql Select Count(1) Into :Count from File
Where Field1 like
Case
When :Filter1 = '' Then Field1
Else :Filter1
End;

Which leaves me with two question:

1. I'm always a little wary of using the LIKE predicate on big files, but
in this example for the case where Filter1 is empty - the pattern
expression contains no wildcard characters (so to speak) so maybe it isn't
so expensive?
2. I'm still not sure of a good way to handle the Regular Expression in an
elegant, dynamic way.

Thanks kindly

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.