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.
In the HTML file we got a drop down which can select multiple values. when we select multiple values the selected value is stored in &PRODUCTCODE the value is '14' OR '35' OR '21'. Can we remove single quote and OR from this and can i have in this pattern 14,35,21.
Is this possible??This message has been edited. Last edited by: Kerry,
I read the manuals and found that i can use STRREP -SET &PRODUCTCODE1 = '14 OR 35 OR 21'; -SET &PRODUCTCODE = STRREP (&PRODUCTCODE1.LENGTH, '&PRODUCTCODE1.EVAL', 4, ' OR ', 1, ',', 40, 'A40');
-TYPE &PRODUCTCODE1 -TYPE &PRODUCTCODE
In this case my output is 14,35,21 perfect.
But My String is -SET &PRODUCTCODE1 = ''14' OR '35' OR '21'';
here if i can remove single quote first then half the work is done.
small problem is you placed two single quotes for each value. In My string only one single quote is being used. -SET &PRODUCTCODE = ''14' OR '35' OR '21'';
No JG, you used this string '''14'' OR ''35'' OR ''21''' But i am using this string ''14' OR '35' OR '21'' there is a difference of string. what i use and you use . So, Please try to use this string ''14' OR '35' OR '21'' and get this output '14 OR 35 OR 21'
If you do not want to test the code with the ECHO ON so that you can actually see what it is doing then there is absolutely no point in trying to help you.
Santhu, download the USING FUNCTIONS manual read the CTRAN function you can translate any character string to anything else you want eg the values for blank, apos, and quote are 32,39, and 34 respectively. turn on the echo as jg suggests, and look at your results
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
This may not be the neatest way to do this and only gets rid of the OR's but maybe you can change it to suit your needs. This is code I wrote almost two years ago to help a developer and hasn't been touched since. It should run by itself.
-* File ar_where_loop.fex
-SET &DIVISION = &DIV.(OR(<AM,AM>,<CHE,CHE>,<CHW,CHW>,<CP,CP>,<CT,CT>,<CV,CV>,<FOR,FOR>,<GB,GB>,<GC,GC>,<GU,GU>,<IR,IR>,<KI,KI>,<KSE,KSE>,<KSW,KSW>,<KY,KY>,<LS,LS>,<MR,MR>,<MTN,MTN>,<MTS,MTS>,<NC,NC>,<NE,NE>,<NEE,NEE>,<NEW,NEW>,<NK,NK>,<NWE,NWE>,<NWN,NWN>,<NWS,NWS>,<NWW,NWW>,<OT,OT>,<PRN,PRN>,<PRS,PRS>,<PRW,PRW>,<RR,RR>,<SC,SC>,<SFE,SFE>,<SFW,SFW>,<SO,SO>,<SWE,SWE>,<SWW,SWW>,<TCE,TCE>,<TCS,TCS>,<TCW,TCW>,<TX,TX>,<UP,UP>)).Select one or more DIVISIONS. ;
-***** EXAMPLE of selection ****
-* DIV = 'AM' OR 'CHW' OR 'CP' OR 'FOR'
-* Loop thru this list & add single quotes and commas where necessary around options - to go in the SQL IN statement
-* NEED TO TAKE THE "OR" OUT OF THE STRING PASSED FROM THE WEB SERVER
-SET &IVTGTYP=&DIV;
-SET &LENGTH_LEFT = &IVTGTYP.LENGTH;
-SET &WHR = ' ';
-DIVLOOP
-SET &SP_POS=POSIT(&IVTGTYP,&LENGTH_LEFT,' ',1,'I2');
-* IF THERE ARE NO MORE ORS, YOU HAVE THE LAST ONE AND CAN EXIT THE LOOP.
-IF &SP_POS NE 0 GOTO DIVGET;
-SET &DIVTOK=&IVTGTYP;
-GOTO DIVEND
-DIVGET
-SET &TOKEND=&SP_POS-1;
-SET &TOKLEN=&SP_POS-1;
-SET &TOKFMT='A'|&TOKLEN;
-*-TYPE SP_POS=&SP_POS TOKEND=&TOKEND TOKLEN=&TOKLEN
-* GET THE FIRST DIVISION IN THE STRING
-SET &DIVTOK = SUBSTR(&LENGTH_LEFT, &IVTGTYP, 1, &TOKLEN, &TOKLEN, '&TOKFMT');
-*-TYPE DIVTOK=&DIVTOK
-* MOVE THE STARTING POSITION PAST THE EXTRACTED DIVISION AND THE ' OR ' AND GET THE REST OF THE STRING.
-SET &STR_START=&TOKLEN+5;
-SET &STR_LENGTH=&LENGTH_LEFT;
-SET &LENGTH_LEFT=&LENGTH_LEFT-&TOKLEN-4;
-*-TYPE LENGTH LEFT=&LENGTH_LEFT STR_START=&STR_START STR_LENGTH=&STR_LENGTH
-SET &STRFMT='A'|&LENGTH_LEFT;
-*-TYPE STRFMT=&STRFMT
-SET &IVTGNEW=SUBSTR(&STR_LENGTH,&IVTGTYP,&STR_START,&STR_LENGTH,&LENGTH_LEFT,'&STRFMT');
-*-TYPE &IVTGNEW
-SET &IVTGTYP=&IVTGNEW;
-SET &WHR = &WHR || &DIVTOK || ',';
-GOTO DIVLOOP
-DIVEND
-SET &WHR = &WHR || &DIVTOK;
-* Parameter is set to pass to SQL select statement
-*-SET &FWHR = &WHR ;
-TYPE &WHR
Both generate the required input string you would get from a multi select drop down.
The problem is Santhu does not understand even the basics of WebFOCUS and he wants someone to do his job for him but he is not prepared to accept the advice given.
You seem to be having a hard time understanding the recommendations of your fellow Focal Pointers. If you do not understand it, then do it another way. I would suggest that you use JavaScript. If you change your PRODUCTCODE from a list box to a hidden input, then add another list to contain the original list, you can add some JS code prior to the OnExecute() function to set the value of PRODUCTCODE to the desired value.
Hint: If you use the Prototype JavaScript Framework 1.6 or higher, this can be done in one line of JavaScript.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott