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 have a strange problem while trying to use a wildcard against a Postgres database.
Say I am trying to filter on FIELDNAME for a string that starts with "C" and has a "G" in it.
WHERE FIELDNAME LIKE 'C%G';
Webfocus returns the proper results. But when I look at the generated SQL that was sent to the DB, the WHERE is missing and I see the message
(FOC2598) FOCUS IF/WHERE TEST CANNOT BE PASSED TO SQL : FIELDNAME
Obviously we need the where condition to go to the DB.
If I try
WHERE FIELDNAME LIKE '%C%G%';
Then it works and the where is passed to the DB. But that is not what I want. I need the string to start with "C".
I tested this against SQL Server and the problem does not occur. So it seems to be specific to Postgres.
Has anybody seen this behaviour before with Postgres? As I said, I am getting the proper results, but the generated SQL passed to the DB must contain the where for this to be usable.
Thanks
JodyeThis message has been edited. Last edited by: Kerry,
This is normal behaviour in a DBMS. For example, in this DB2 SQL -
No rows retrieved:
SELECT DAY_OF_WEEK FROM BASEL.TIME_D
WHERE DAY_OF_WEEK LIKE 'M%y'
FETCH FIRST 10 ROWS ONLY;
Some rows retrieved:
SELECT DAY_OF_WEEK FROM BASEL.TIME_D
WHERE DAY_OF_WEEK LIKE 'M%y%'
FETCH FIRST 10 ROWS ONLY;
My interpretation:
DAY_OF_WEEK is a CHARACTER column with a length of 10. For 'Monday', the 'y' is the 6th character, but 'M%y' is looking for a value where the last (10th) character is a 'y' and there aren't any. Unfortunately, 'M%y%' will retrieve values I am not interested in and would have to filter them out with some other method. In this case I would let WebFOCUS take care of the filter.
As you mention, this behaves as expected in MS SQL Server.
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
Here's a potential solution: put both WHERE LIKE statements in the selection criteria, one gets translated to SQL, the other is taken care of by WebFOCUS - this would have the dbms return some rows which would be filtered by WebFOCUS, better than the dbms returning all rows which would be filtered by WebFOCUS...
WHERE FIELDNAME LIKE 'C%G%';
WHERE FIELDNAME LIKE 'C%G';
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
Did you test the SQL pass-through on the Progres db or on the MS SQL Server db? I found that SQL pass-through did not work on a DB2 db but did work on MS SQL Server.
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
Strange that it worked - I thought it would behave like DB2.
This SQL returns some rows:
SELECT T1."APPROV_OFFICER_NM"
FROM db1.CUSTOMER T1
WHERE (T1."CUST_NM" LIKE 'R%K ')
group BY
T1."CUST_NM"
ORDER BY
T1."CUST_NM"
FOR FETCH ONLY;
Entering a specific number of blanks after the last character returns some rows, but not all the expected rows - this is how it behaves outside WebFOCUS, SQL run from a DB2 client tool.
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
Firstly, Francis - you seem to be mixing up Postgres with Progress. Those are different databases. Postgres is a modern SQL relational database, Progress is an old beast based on a 4GL language other than SQL (although they claim to support SQL too).
To the original poster; Yes, your query should work just fine. I think the Postgres SQL adapter may be a bit too conservative there, although that query isn't going to perform well.
Maybe you can rewrite it to: WHERE FIELDNAME LIKE 'C%'; WHERE FIELDNAME LIKE '%G';
That should result in the same results.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :