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] help on the strrep

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] help on the strrep
 Login/Join
 
Gold member
posted
hi, I am trying to replace the OR into , so that I can use it in the sql passthru.

What I have is this:
The string will look like this:
'AA' OR 'BB' OR 'CC';
and I want it to make this into
WHERE TESTVAL IN('AA','BB',CC');

-SET &OR=''' OR ''';

This is my strrep:
STRREP(&STR.LENGTH,(&STR),4,&OR,1,',',&STR.LENGTH,'A&STR.LENGTH') ;

what is it that I am missing? this does not work.

Thanks in advance!!

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


on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment
Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
 
Posts: 71 | Registered: May 23, 2004Report This Post
Expert
posted Hide Post
-SET &INVAR1 = '''AA'' OR ''BB'' OR ''CC''';

-* STRREP (inlength, instring, searchlength, searchstring, replength, repstring, outlength, outstring)

-SET &OUTVAR1 = STRREP (&INVAR1.LENGTH, &INVAR1, 4, ' OR ', 1, ',', &INVAR1.LENGTH, 'A&INVAR1.LENGTH');

-TYPE &INVAR1 - &OUTVAR1


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
-SET &STR = '''AA'' OR ''BB'' OR ''CC''';
-SET &ORSTR = STRREP(&STR.LENGTH,&STR,6,''' OR ''',3,''',''',&STR.LENGTH,'A&STR.LENGTH') ;
-TYPE ORSTR = &ORSTR


Also have to make special provision for single value without an OR.
If &STR is all numeric strrep will give an error.


WebFOCUS 8.2.06
 
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010Report This Post
Virtuoso
posted Hide Post
Your fourth argument, &OR, references its value 
      "' OR '"
whose length is 6 (two quotes, 2 spaces, 2 letters), 
not 4.

Either replace the six characters "' OR '" by the three characters "','" (and set the length arguments accordingly), as dbeagan 
suggests, or use
-SET &STR2 = STRREP(&STR.LENGTH,&STR, 4,' OR ', 3,',', &STR.LENGTH,'A&STR.LENGTH') ;
to replace 4 by 1

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
Thank you very much! got it!


on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment
Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
 
Posts: 71 | Registered: May 23, 2004Report 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] help on the strrep

Copyright © 1996-2020 Information Builders