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] Passing in OR statement as parameter

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Passing in OR statement as parameter
 Login/Join
 
Member
posted
I tried searching for this but I can't find anything, so please point me in the right direction if this has already been discussed.

I am building the OR's for a WHERE statement outside of webfocus and trying to pass it in as a parameter. For example:
WHERE ACCT_UNIT EQ &ACCT_UNITS

&ACCT_UNITS needs to pass in '1234' OR '4321' OR '5432'. I can't seem to get this to work. I think the single quotes are throwing me off. Hopefully this makes sense. I also willing to try any other route if someone has a better suggestion.
Thanks

This message has been edited. Last edited by: Tim Bayer,



------------------------------------
WebFOCUS Version 7.6.2
 
Posts: 17 | Registered: September 08, 2008Report This Post
Guru
posted Hide Post
Tim:

What do you see in WF when you do -TYPE &ACCT_UNITS at the beginning of your focexec? This is visible when View/Source for the HTML output.

Single quotes can be a problem when passed from outside WF.

One tactic would be to replace the single quote with another character (like a tilde '~') outside WF and then use the STRREP function to translate the tilde to a single quote.

IHTH.



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 2006Report This Post
Platinum Member
posted Hide Post
try this for the variable
-SET &ACCT_UNIT = ' ''ENGLAND'' OR ''JAPAN'' OR ''ITALY'' ';
TABLE FILE CAR
SUM SALES
BY COUNTRY
WHERE COUNTRY EQ &ACCT_UNIT;
END


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Platinum Member
posted Hide Post
When creating "OR" strings in something like JAVASCRIPT I use the "IN" syntax. That is

WHERE COUNTRY IN ('ENGLAND','JAPAN')

Also keep in mind the ".QUOTEDSTRING" property for Dialgue manager viables.

But beware if you apply this to a Dialogue Manager variable that does not exist the agent will crash. This is fixed in release 7.6.5


Jim Morrow
Web Focus 7.6.10 under Windows 2003
MVS 7.3.3



 
Posts: 129 | Registered: June 01, 2005Report This Post
Member
posted Hide Post
Thank you for the great suggestions, I have tried them along with several others and I am still not able to pass in my string.

gregv, I don't think I can use STRREP because I don't know what the size of the string will be.

Spence, this did not work for me, have you gotten this syntax to work?

Jim, It sounds like you are doing something very similar to what I need. Would it be possible for you to post some code examples for both the javascript side and the webfocus side? I could not get this working for me.

Thanks again for the ideas.



------------------------------------
WebFOCUS Version 7.6.2
 
Posts: 17 | Registered: September 08, 2008Report This Post
Platinum Member
posted Hide Post
this does work for me.
there are 2 single quotes around the value.
''ENGLAND''
copy and paste the example and try it.


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Expert
posted Hide Post
As for length, you can alway append the .LENGTH property to a variable to learn the length, i.e.

-SET &VARLEN=&VAR.LENGTH;

You can also use this syntax in a function declared in Dialogue Manager.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Member
posted Hide Post
Thanks Spence,

I think that did the trick, I was using a double quote.

Also, thanks GinnyJakes for the tip on the .LENGTH property.



------------------------------------
WebFOCUS Version 7.6.2
 
Posts: 17 | Registered: September 08, 2008Report 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] Passing in OR statement as parameter

Copyright © 1996-2020 Information Builders