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     [Solved] Nested where?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Nested where?
 Login/Join
 
Platinum Member
posted
Is this statement possible? I just can't get it to work right?

WHERE Channel CONTAINS 'TEAM' OR (GroupName CONTAINS 'Bus' AND Channel CONTAINS 'BUS BKG');  


Thanks for any help possible

JOE

This message has been edited. Last edited by: JOE,


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Virtuoso
posted Hide Post
Did you try splitting it into two where statments?
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
Seems to be OK for FOCUS databases:

TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY MODEL

WHERE MODEL CONTAINS 'AUTO' OR (COUNTRY CONTAINS 'AN' AND MODEL CONTAINS 'OR AU'); 
END



What DBMS are you reading? Did you trace the SQL that is generated? Coult the "CONTAINS 'BUS BKG'" be the issue?


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
Platinum Member
posted Hide Post
Thanks,

I keep getting this error message:

 0 ERROR AT OR NEAR LINE     21  IN PROCEDURE SQLOUT  FOCEXEC *
 (FOC262) UNBALANCED PARENTHESES
 (FOC009) INCOMPLETE REQUEST STATEMENT
 BYPASSING TO END OF COMMAND
 0 ERROR AT OR NEAR LINE     43  IN PROCEDURE EX4_BAK1FOCEXEC *
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLDSOURCE
 BYPASSING TO END OF COMMAND
 0 ERROR AT OR NEAR LINE     66  IN PROCEDURE EX4_BAK1FOCEXEC *
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLDSOURCE
 BYPASSING TO END OF COMMAND
 0 ERROR AT OR NEAR LINE     91  IN PROCEDURE EX4_BAK1FOCEXEC *
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLDSOURCE
 BYPASSING TO END OF COMMAND
 0 ERROR AT OR NEAR LINE    111  IN PROCEDURE EX4_BAK1FOCEXEC *
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLDSOURCE
 BYPASSING TO END OF COMMAND
 0 ERROR AT OR NEAR LINE    134  IN PROCEDURE EX4_BAK1FOCEXEC *
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLDSOURCE
 BYPASSING TO END OF COMMAND
 0 ERROR AT OR NEAR LINE    157  IN PROCEDURE EX4_BAK1FOCEXEC *
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLDSOURCE
 BYPASSING TO END OF COMMAND
 0 ERROR AT OR NEAR LINE    180  IN PROCEDURE EX4_BAK1FOCEXEC *
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLDTOTAL
 0 ERROR AT OR NEAR LINE    184  IN PROCEDURE EX4_BAK1FOCEXEC *
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLDTOTAL
 BYPASSING TO END OF COMMAND


 


Here is my code:

 TABLE FILE SQLOUT

SUM
     Units
     UnitsPace
     UnitsMTDGoal
     UnitsGoal
     RevCred
     RevCredPace
     RevCredMTDGoal
     RevCredGoal
     OpenBal
     OpenBalPace
     OpenBalMTDGoal
     OpenBalGoal
BY DivisionName
BY GroupName
BY Channel
BY CoreFlag
WHERE DivisionName EQ '&DivisionName';
WHERE GroupName EQ '&GroupName';
-*WHERE ProductGroup NE 'CONSUMER CROSS SELL';
-*WHERE ProductGroup NE 'BUSINESS CROSS SELL';
-*WHERE ( Channel CONTAINS 'TEAM' ) OR ( GroupName CONTAINS 'Bus' ) AND ( Channel CONTAINS 'BUS BKG' ));
WHERE Channel CONTAINS 'TEAM' OR (GroupName CONTAINS 'Bus Bank Sales' AND Channel CONTAINS 'BUS BKG'); 

-*WHERE Channel CONTAINS 'TEAM';

ON TABLE HOLD AS HLDSOURCE FORMAT ALPHA

END
-RUN 


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Virtuoso
posted Hide Post
I don't suppose it's complaining about that commented line with the unbalanced parenthesis?

Does the statement work if you add more parenthesis?
WHERE (Channel CONTAINS 'TEAM') OR ((GroupName CONTAINS 'Bus Bank Sales') AND (Channel CONTAINS 'BUS BKG'));


Are your parenthesis actual ASCII parenthesis, or is one of them a different character that looks like a parenthesis?

Do your variables &GroupName or &DivisionName perhaps contain a single quote? I suspect that &GroupName might contain something like:
-SET &GroupName = Some value'(;

That would break this table request.

What also looks peculiar is that your TABLE statement seems to have leading space. Perhaps that's just a copy/paste error in this posting, but if not, WF might be skipping the statement and interpret things a little different from what you expect.


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
Move your where clauses into the SQL as it could lead to less records being returned and therefore "better" in the long term.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
quote:
0 ERROR AT OR NEAR LINE 21 IN PROCEDURE SQLOUT FOCEXEC *
(FOC262) UNBALANCED PARENTHESES


quote:
-*WHERE ( Channel CONTAINS 'TEAM' ) OR ( GroupName CONTAINS 'Bus' ) AND ( Channel CONTAINS 'BUS BKG' ));


Are you sure it's commented out when you get the error message?


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Platinum Member
posted Hide Post
Thanks for all your replies. I figured it out..I worked it through the GUI Expression grid which excatually worked to what I wanted:

 WHERE ( Channel CONTAINS 'TEAM' ) OR ( GroupName CONTAINS 'Bus Bank' ) AND ( Channel CONTAINS 'BKG' ) OR ( GroupName CONTAINS 'Bus Bank' ) AND ( Channel CONTAINS 'CENT' );
 


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report 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     [Solved] Nested where?

Copyright © 1996-2020 Information Builders