× 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.



I have several SQL Views that resolve a "lookup-table driven" value in a PF from the internal representation to the display value, using an SQL UDF called "DISPLAYVAL."

In the fragment below, "tbl" is a field that identifies the relevant range of records in our lookup table, i_key (a parameter to the function) is the internal representation we are resolving, PTBLE, PCODE, STBLE, and SCODE are keys to our lookup-table file, DEF is the display value listed in the lookup-table file, and result is what we are returning.

select DEF INTO result from FOO/LOOKUP where PTBLE = substring(tbl from 1 for 3) and PCODE = substring(i_key from 1 for 5) and STBLE = ' ' and SCODE = ' ';
. . .
> RETURN result;

It works great, for resolving the internal representation to the display value: if, for a given column (we'll call it "USER"), a value of 00000 in the file is assigned to 'Doe, John Q.', the view shows a meaningful 'Doe, John Q.' instead of the less user-friendly value of 00000.

But I've just been informed that the users would like to be able to search on at least some of these fields. And that doesn't work at all, e.g., SELECT * FROM FOO/BAR WHERE USER = 'Doe, John Q.' returns absolutely nothing.

Presently, for the fields that call DISPLAYVAL in the Views, I'm not also including the unresolved values, but that could change.

Any suggestions on what to do here?

--
JHHL

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.