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     Dynamically build where statement

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Dynamically build where statement
 Login/Join
 
Master
posted
I want to build a WHERE fld eq 'a' or b' statement in dialogue manager.

I am having trouble getting the apostrpohes correct?

Anyone have suggestions?

Thanks! Cool


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Master
posted Hide Post
Since I am using an OR statement in the WHERE, I'd like to post my code here.

-SET &GROUP4 = 'COAL';
-SET &XGRP4 = IF &GROUP4 EQ 'COAL' THEN 'WHERE GROUP4 EQ 'COAL UNIT' OR 'COAL NON UNIT'||';' ELSE &GROUP4;
-TYPE &|XGRP4 = &XGRP4
-EXIT

Thanks very much Confused


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
tom
i call it the rule of 1-2-3
here's an example

-SET &FILTER = IF &GROUP EQ 'RETAIL' THEN 'IF CUST_ID IS ''T0020'' OR ''T9111''' ELSE
- 'IF CUST_ID IS ''T9111''' ;

1 apostrophe, then 2, then 3;
so, for you
SET &XGRP4 = IF &GROUP4 EQ 'COAL' THEN 'WHERE GROUP4 EQ ''COAL UNIT'' OR ''COAL NON UNIT'' ';

now, if you are inserting an &var, its gets a little more complicated, rule becomes 1-3-4

-SET &FILTERFAB = IF &MYFAB IS 'ALL' THEN ' ' ELSE 'IF FABCLASS IS ''' | &MYFAB | '''' ;




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
Tom :
You could do this too...

-SET &QT='''' ;
-* (Four ticks end up to be one in the next statement *-
-*
-SET &XGRP4 = IF &GROUP4 EQ 'COAL' THEN
- ('WHERE GROUP4 EQ ' | &QT || 'COAL UNIT' || &QT | ' OR ' | &QT || 'COAL NON UNIT' || &QT ||';' )
- ELSE &GROUP4;
-*
Susannah's solution may be simpler in your case here, but the '''' technique might be something for you to consider when you have more complex statements to build.

Sandeep Mamidenna


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Hi Tomsweb,

Quotes within a quote need to be double single quotes as shown:
-SET &GROUP4 = 'COAL';
-SET &XGRP4 = IF &GROUP4 EQ 'COAL' THEN 'WHERE GROUP4 EQ ''COAL UNIT'' OR ''COAL NON UNIT''||'';''' ELSE &GROUP4;
-TYPE &|XGRP4 = &XGRP4
-EXIT



Hope this helps. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by BlueZone:
Tom :
You could do this too...

-SET &QT='''' ;
-* (Four ticks end up to be one in the next statement *-
-*
-SET &XGRP4 = IF &GROUP4 EQ 'COAL' THEN
- ('WHERE GROUP4 EQ ' | &QT || 'COAL UNIT' || &QT | ' OR ' | &QT || 'COAL NON UNIT' || &QT ||';' )
- ELSE &GROUP4;
-*
Susannah's solution may be simpler in your case here, but the '''' technique might be something for you to consider when you have more complex statements to build.

Sandeep Mamidenna


interesting solution, I will keep this in mind, thanks




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 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     Dynamically build where statement

Copyright © 1996-2020 Information Builders