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 textarea whose multiple property is Set to ON.A user can enter multiple zipcodes separated by commas.The requirement is I should bring all the records that has the zipcode that was entered in the textarea.
TABLE FILE W_ADDR
PRINT *
WHERE ZIPCODE LIKE &ZIP;
END
-EXIT
This worked for me.
Now there is a little change in the requirement where we should bring the records that start with the entered zipcodes.
for example if I enter 55116,55124 we should bring the records that has 55116,551161234,551164567,55124,551241234,551245678 values for the zipcode field.For this scenario my above code won't work. I have to use '%' in the where clause.But my &ZIP has values separated by 'OR' how can I achieve this.Can somebody help me. Thanks.This message has been edited. Last edited by: Kerry,
The value for &ZIP is '55116' OR '55124'. I have the Multiple property set for the Textarea.I think that is the reason i am getting each value separated by OR.
ZIPCODE is VARCHAR. Entering 55116,55124 convert to '55116' OR '55124'.Thanks a lot for your time.This is important for me.
Just try changing the LIKE caluse to CONTAINS. If the values are being passed as '55116' OR '55124' (i.e alphanumeric) to the fex from the launch page CONTAINS should work. You can avoid appending a % in this way.
thanks SashankaThis message has been edited. Last edited by: Severus.snape,
WF 7.7.03/Windows/HTML,PDF,EXL POC/local Dev Studio 7.7.03 & 7.6.11
The quickest way to solve this is to ask the user to enter the "%" wildcard when they want to select zipcodes starting with the entered values:
55116%,55124%
If that's not acceptable, then you'll have to parse the variable &ZIP and insert the % wildcard using Dialogue Manager.
Here's an example using the CAR file.
Var ZIP contains the passed values entered by the user. Var ZIP1 strips the single quotes to make it easier for the next command. Var Zip2 replaces the ' OR ' between each entered value with '% OR '. It also re-adds the single quotes. It also adds a single quote at the beginning and a %' at the end to complete the parsed string.
-SET &ECHO=ALL;
-SET &ZIP = '''CAN'' OR ''ENG'' OR ''ITA''';
-SET &ZIP1 = STRIP(&ZIP.LENGTH, &ZIP, '''', 'A&ZIP.LENGTH');
-SET &ZIP2 = '''' | STRREP (&ZIP1.LENGTH, &ZIP1, 4, ' OR ', 8, '%'' OR ''', 300, 'A300') || '%''';
-? &ZIP
TABLE FILE CAR
PRINT *
WHERE COUNTRY LIKE &ZIP2
HEADING
"&ZIP2"
END
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
We can keep it simple with "IN". Consider the following:
-SET &RCOSTS = '8878, 13491, 5610' ;
TABLE FILE CAR
SUM 'CAR.BODY.RETAIL_COST'
'CAR.BODY.DEALER_COST'
BY 'CAR.ORIGIN.COUNTRY'
BY 'CAR.COMP.CAR'
BY 'CAR.CARREC.MODEL'
WHERE RCOST IN (&RCOSTS)
END
Where "&RCOSTS" is your "&ZIP".
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005