As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I just used this method of performing a case-insensitive search and it works well.
In prior versions of WebFOCUS, you had to change the case of the string being searched for and the data column being searched to properly perform a case-insensitive search.
In WF v7.7 you can set the collation sequence which affects sorting, aggregation and WHERE statements.
SET COLLATION=SRV_CI -RUN
"Bases collation sequence on the LANGUAGE setting, and is case-insensitive"
The WHERE statement is now case-insensitive.
Look up "Controlling Collation Sequence" in the documentation.This message has been edited. Last edited by: Francis Mariani,
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
I'd like to see the underlying SQL statement that the iWay translator is using when hitting the database just to make sure the filter is passed on to the DB server to handle.
I'll try to allocate some time to test this ... one of these days.
Hmmm, that must be because apparently SQL Server does case-insensitive search by default. some other databases won't make them just like that.
In Oracle for instance, one needs to adjust session settings (NLS_SORT and NLS_COMP) previous to issuing a SELECT statement for that to happen, or resort to an ugly: WHERE UPPER(field) = 'VALUE', which usually renders any index on "field" useless unless such an index is a function-based one.
That's why I wondered if iWay were doing some 'magic' in the underlying SQL to make sure that "case-insensitivity" kicked in depending on the database adapter.
I just tested this in Oracle 10g. As you said, the underlying SQL does not get impacted so the COLLATION stuff is happening at the WebFOCUS level and nothing gets passed to the database to support the case-insensitive search.
So, for databases that support that stuff by default such as SQL Server that settings makes sense but it's of no use when the DB technology is slightly different. My attempt to TABLE FILE oracle_table WHERE FIRST_NAME = 'fRaNcIs' rendered rien.
Based on what I understood after reading about SET COLLATION, before this setting was available any filter such as "WHERE FIRST_NAME EQ 'FRANCIS'" issued against a SQL Server database table from WebFOCUS would return values such as: FRANCIS, francis, Francis, etc. as that's how that DB operates but then WebFOCUS would perform a second-level filter to exclude anything different to 'FRANCIS' to honour the original WHERE condition.
Apparently with COLLATION=SRV_CI WebFOCUS no longer performs that second-level filter so every record fetched from the database is assumed to be valid.
This may still be used with Oracle and others provided one does stuff at the DB level to guarantee that case-insensitive searches are supported. COLLATION will make sure whatever we return as result will find its way into the reports.
Very interesting feature nevertheless.
Sorry for overusing of your name in my sample WHERE's above
Yup. I think very few databases support case-insensitive search by default. They don't do it unless explicitly instructed to do so, which is what I thought SET COLLATION did behind the scenes when TABLE FILE was converted to SQL but it really has nothing to do with the database but with the FOCUS engine directly.
That said, I can attempt to do that in Oracle by issuing something like:
alter session set NLS_SORT=BINARY_CI;
alter session set NLS_COMP=LINGUISTIC;
Any WHERE condition issued after that on a VARCHAR2 field will do a case-insensitive comparison.
Those alter sessions can be issued via SQL Passthru before the actual TABLE FILE request takes place.
There must be something similar for DB2 ...This message has been edited. Last edited by: njsden,
I would say that the documentation should make it very clear that this is a FOCUS-specific setting non applicable to RDBMS (unless they do it by default such as SQL Server). That's not too bad I guess ... after all, we all know that JOIN ... TO UNIQUE ... has a semantically and technically different meaning in FOCUS vs. databases so COLLATION would probably fall under the same group.
Is it possible this must be set in the server profile and not in a fex?
What in particular Francis? SET COLLATION or the specific database session-level settings?
Well, either I guess but there are drawbacks to just go ahead and alter NLS settings in Oracle. If I'm not mistaken, if one changes NLS_SORT and NLS_COMP then any existing indices will be useless to support the new case-insensitive query.
This may or may not be the case in other databases out there, which is, I think, why IBI does not try to "force" the functionality onto those DB servers but just keep it at the FOCUS level. If the database supports it, SET COLLATION will honour those case-insensitive filters which was not the case before that setting came into effect.
Definitely the documentation about SET COLLATION should make that clearer.
I haven't looked at IBI's Adapter for Oracle documentation to see if there is any mention of COLLATION and how to make it work. I'll try to search to see what I can find.
Yes, the SET COLLATION setting. It is mentioned that it should be added to the server profile (I suppose EDASPROF), but I can't see how that is different than doing it in a fex.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server