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] How to add single quotes around a value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to add single quotes around a value
 Login/Join
 
Guru
posted
Hi,

I have a textbox and Iam entering multiple Id's separated by commas(say abcd,xyz1,pqrs) and while passing to the fex file I need the single quotes to be around the ID's(say something like select * from table where ID in ('abcd','xyz1','pqrs')...

Could anyone please help me on how to do this.

Thanks a lot in advance!

Regards,
Apoorva

This message has been edited. Last edited by: <Kathryn Henning>,
 
Posts: 270 | Registered: October 30, 2014Report This Post
Platinum Member
posted Hide Post
Hi,
Perhaps you can use the STRREP function?
Concatenate a single quote to the beginning and end, then replace the comma with quote-comma-quote.

STRREP: Replacing Character Strings
The STRREP replaces all instances of a specified string within a source string. It also supports replacement by null strings.

Syntax: How to Replace Character Strings
STRREP (inlength, instring, searchlength, searchstring, replength,
repstring, outlength, output)


WebFOCUS 8.2.06 mostly Windows Server
 
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008Report This Post
Gold member
posted Hide Post
Hi,
STRREP is fucntion that solves most cases. But it also has it own limitations.

Check this thread, there is very nice solution for it:
http://forums.informationbuild...411028331#2411028331


Release: WebFOCUS 8104, AppStudio: 8105
OS: Windows
Output: HTML,Excel,Active Reports
 
Posts: 89 | Registered: November 19, 2013Report This Post
Member
posted Hide Post
Try this

''''|'value'|''''

that's 4 single quotes


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 24 | Registered: July 01, 2014Report This Post
Guru
posted Hide Post
Hi,

Thanks to all of you for your inputs...Would you mind posting a sample solution for this below CAR file :

-DEFAULT &COUNTRY=ENGLAND,ITALY;



TABLE FILE CAR

PRINT *

WHERE COUNTRY IN (&COUNTRY)

END

-RUN


Thanks a lot in advance!

Regards!
 
Posts: 270 | Registered: October 30, 2014Report This Post
Virtuoso
posted Hide Post
Twanette is correct.
-DEFAULT &COUNTRY= 'ENGLAND,ITALY'

-SET &COUNTRY = TRUNCATE(&COUNTRY);

-SET &COUNTRY = '''' || STRREP (&COUNTRY.LENGTH,&COUNTRY,1,',',3,''',''',1000,'A1000') || '''';

-SET &COUNTRY = TRUNCATE(&COUNTRY);

The DEFAULT has to have quotes around and no semi-colon at the end, as the comma splits the value and the semi-colon is not required. The first TRUNCATE may be useful when value comes from an HTML form. The 1000/A1000 length can be any value that would work with your process.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Guru
posted Hide Post
Hi,

Thanks a lot Alan and everyone for your help.
It worked!

Regards
 
Posts: 270 | Registered: October 30, 2014Report This Post
Platinum Member
posted Hide Post
Here's a little explanation of the 4 ticks:

One tick starts the string literal.
Two ticks escapes it - implying you want to print a single tick - as opposed to ending the string.
The very last tick closes the string literal.


webFOCUS 8207.15
WindowsServer 2019
 
Posts: 120 | Location: Minnesota | Registered: August 26, 2013Report This Post
Guru
posted Hide Post
Hi,

Thanks a lot everyone for the help.
It worked!!

Regards!
 
Posts: 270 | Registered: October 30, 2014Report 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] How to add single quotes around a value

Copyright © 1996-2020 Information Builders