Focal Point
using escape characters

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8001018331

November 02, 2004, 10:22 AM
<Kalyan>
using escape characters
please look at code below


TABLE FILE EMPLOYEE
PRINT *
WHERE COURSE_NAME EQ 'WHAT\'S NEW IN FOCUS'
END

I used the back slash as the help file says it could be used to as an escape character.. When I run the code above I get a error saying unmatched quotes?? What am I doing wrong?
November 02, 2004, 01:19 PM
Leah
It is interpretting what you have with the embedded quote

WHERE COURSE_NAME EQ 'WHAT\'S NEW IN FOCUS'

as if it should be 'what\' and then
S NEW IN FOCUS' and wants another quote.

Other than in headings which have the begin and end double quotes, I've never tried what you have for a quote.
November 02, 2004, 02:08 PM
jimster06
This is what I found in the HELP file

Example: Using Quote‑Delimited Literal Strings
For example, if a report request contains the following command

IF AIRPORT EQ 'O''HARE'WebFOCUS will interpret the literal string 'O''HARE and look for a data source value of O'HARE.

HTH
November 02, 2004, 02:15 PM
Spence
With the an escape character you need to use LIKE and not EQ.
WHERE COURSE_NAME LIKE 'WHAT\''%' ESCAPE '\'


Use 2 single quotes if you are searching for the entire value.
WHERE COURSE_NAME EQ 'WHAT''S NEW IN FOCUS' ;
November 02, 2004, 02:17 PM
Stan
My understanding has always been that if you want a single tick mark, you simply place two of them in a row to make that happen. Here is a snippet from some code that might be an example:

-SET &WHRLMT = 'WHERE FLD1 EQ ''Y''';

I'd be tempted to place your statement in a variable like so:
-SET &LMT1 = 'WHERE COURSE_NA EQ 'WHAT''S NEW IN FOCUS'';

Hope this works for you.

Stan