Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How to use COLLATION=SRV_CI?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to use COLLATION=SRV_CI?
 Login/Join
 
Expert
posted
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
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.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
The SQL doesn't look different - the value in the WHERE statement is however you type it.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
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.

Thanks for checking that up Francis. Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
quote:
SET COLLATION=SRV_CI


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 Big Grin



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Master
posted Hide Post
Well, for the record.

it's doesn't work here...

( iSeries / DB2 )


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
quote:
it's doesn't work here ... iSeries / DB2 ...


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,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
Yes, you're unfortunately right - the setting appears to make no difference in DB2. I'll change the title of this thread.

Another great but half-baked idea. I read through the documentation and found nothing restricting successful use of this to particular types of dbms.

Creating Reports With WebFOCUS Language > Sorting Tabular Reports > Controlling Collation Sequence


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Is it possible this must be set in the server profile and not 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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
quote:
Another great but half-baked idea


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.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
quote:
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.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How to use COLLATION=SRV_CI?

Copyright © 1996-2020 Information Builders