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     [CLOSED]There's gotta be something I missed...

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]There's gotta be something I missed...
 Login/Join
 
Guru
posted
Please help me bring back my sanity.

Yes. We're still on 7.7.03. Don't judge.

I'm connecting to an Oracle 10g table.

I have a field that has has a value with an apostrophe.

So, I do a simple TABLE FILE as follows:

TABLE FILE MYTABLE
PRINT *
WHERE MYFIELD EQ 'O''Brien';
END

Doesn't work.

TABLE FILE MYTABLE
PRINT *
WHERE MYFIELD EQ 'O'Brien';
END

Doesn't work.

TABLE FILE MYTABLE
PRINT *
WHERE MYFIELD EQ 'O' || '''' || 'Brien';
END

Works.

REALLY? I have to convert the &var that represents the value O'Brien to all that? I'm getting a headache just thinking about the steps I have to go through to do it, especially since the value is coming from a multi-select combobox with values in quotes separated by OR... I already have a headache thinking about converting ' to '' as it is.

Okay, so... first of all, is there some trick to multi-select that will double apostrophe the apostrophes as it adds the quotes and OR?

Secondly, do I really have to split the apostrophes out and concatenate them to the rest of the values?

Have I gone cuckoo?

This message has been edited. Last edited by: <Emily McAllister>,


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Virtuoso
posted Hide Post
Once you manage to stuff O'Brien into &var, e.g.
-DEFAULT &var=O'Brien

use
WHERE MYFIELD EQ &var.QUOTEDSTRING;
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
I just tested this in WF 8105 and 'O''Brien' works. The data is in a FOCUS file.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
Also, turn SQL traces on to see the SQL generated by WF. Your original code should work.


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
Guru
posted Hide Post
Creating a Standard Quote-Delimited String

Character strings must be enclosed in single quotation marks to be handled by most database
engines. In addition, embedded single quotation marks are indicated by two contiguous
single quotation marks. Quotation marks are required around variables containing delimiters,
which include spaces and commas.
The QUOTEDSTRING suffix on a Dialogue Manager variable applies the following two
conversions to the contents of the variable:
Any single quotation mark embedded within a string is converted to two single quotation
marks.

Single quotation marks are added around the string.
Dialogue Manager commands differ in their ability to handle character strings that are not
enclosed in single quotation marks and contain embedded blanks. An explicit or implied -
PROMPT command can read such a string. The entire input string is then enclosed in single
quotation marks when operated on by .QUOTEDSTRING.

Note: When using the -SET command to reference a character string, ensure the character
string is enclosed in single quotes to prevent errors.

Syntax: How to Create a Standard Quote-Delimited Character String
&var.QUOTEDSTRING
where: &var Is a Dialogue Manager variable.


Creating a Standard Quote-Delimited Character String
The following example shows the results of the QUOTEDSTRING suffix on input strings.
-SET &A = ABC;
-SET &B = 'ABC';
-SET &C = O'BRIEN;
-SET &D = 'O'BRIEN';
-SET &E = 'O''BRIEN';
-SET &F = O''BRIEN;
-SET &G = OBRIEN';
-TYPE ORIGINAL = &A QUOTED = &A.QUOTEDSTRING
-TYPE ORIGINAL = &B QUOTED = &B.QUOTEDSTRING
-TYPE ORIGINAL = &C QUOTED = &C.QUOTEDSTRING
-TYPE ORIGINAL = &D QUOTED = &D.QUOTEDSTRING
-TYPE ORIGINAL = &E QUOTED = &E.QUOTEDSTRING
-TYPE ORIGINAL = &F QUOTED = &F.QUOTEDSTRING
-TYPE ORIGINAL = &G QUOTED = &G.QUOTEDSTRING

The output is:
ORIGINAL = ABC QUOTED = 'ABC'
ORIGINAL = ABC QUOTED = 'ABC'
ORIGINAL = O'BRIEN QUOTED = 'O''BRIEN'
ORIGINAL = O'BRIEN QUOTED = 'O''BRIEN'
ORIGINAL = O'BRIEN QUOTED = 'O''BRIEN'
ORIGINAL = O''BRIEN QUOTED = 'O''''BRIEN'
ORIGINAL = OBRIEN' QUOTED = 'OBRIEN'''

Note: The -SET command will remove single quotes around a string. Notice in the example
above that the result of -SET &B = 'ABC' was changed to ORIGINAL = ABC (as shown in the
output), prior to the QUOTEDSTRING conversion.

Source: DN4500991.0310


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report 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     [CLOSED]There's gotta be something I missed...

Copyright © 1996-2020 Information Builders