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've search the WebFocus forum for something like this, and I've found a couple of posts that seem to do what I want, but I can't quite figure them out. I was hoping somebody could help me with this.
I've got a web form that allows user to enter a comma seperated value list. A possible input would be:
"BKTA-%,XGEM%,DT2-PMX-%,XSWWTW2%"
What I'd like to do is generate a where clause like this:
WHERE FIELD LIKE 'BKTA-%' OR FIELD LIKE 'XGEM%' OR FIELD LIKE 'DT2-PMX-%' OR FIELD LIKE 'XSWWTW2%'
Any idea how I can do that? I would assume I'd need to use GETTOK, but my skills with webfocus are not very good. Any hints would be appreciated.
Chris, There is a function called STRREP which is used to replace strings. So you could code something like this: -SET &INSTR='BKTA-%,XGEM%,DT2-PMX-%,XSWWTW2%'; -SET &INSTRLEN=&INSTR.LENGTH; -SET &OR=''' OR '''; -SET &WHERE=STRREP(&INSTRLEN, &INSTR, 1, ',', 6, &OR, 200, 'A200'); (I use an output length of 200 for good measure) Now all the commas have been replaced by ' OR '. Your WHERE statement will then be: WHERE FIELD LIKE '&WHERE' Don't forget the quotes around &WHERE.
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
If you use FOCUS datasource, (never used this on other data source), and the LIKE operator, you have to close the final quote in the string up to within the length of the field, after the STRREP add:
-SET &WHERE = '''' || &WHERE || '''';
and use:
WHERE FIELD LIKE &WHERE ;
otherwise the last screening option may fail.
It works okay if you use EQ instead of LIKE.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
I tried your suggestion, but I think it kept getting caught in an endless loop.
Danny-SRL,
Thank you sir, for making me look like a fool in front of the entire internet . I was so wrapped up in trying to loop through the structure, that it never occurred to me that all I needed to do was replace the commas with "OR"s.
In fact, I didn't even need to do in WebFocus at all. I treated the string in JavaScript before I sent it to WebFocus for execution.
Thanks for the suggestions! I got the report working now, as I want.