[SOLVED] Parameter data contains single quote, how to let the -DEFAULT and where stat
The SQL needs to read data in string format as parameters from -DEFAULT. The data may contain single quote as part of the string. WebFocus treats the single quote as the end of the string. Therefore, it causes mismatching of the original second single quote at the end of the string.
If you are using FOCUS to do the query, then please use WHERE FACILITY EQ '&FACILITY'
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
January 24, 2012, 05:32 PM
TechLights
Thanks for the replies.
The ‘BOARDING PLATFORM 20' BAYLINER’ comes from a drop down selection, how can I find the quote and double it?
7703 on Linux, Windows ReportCaster PDF, HTML, Excel, AHTML, and CSV
January 24, 2012, 05:53 PM
Waz
Have a look at the function STRREP.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
January 25, 2012, 08:02 AM
njsden
quote:
how can I find the quote and double it?
You don't have to. That's what .QUOTEDSTRING is supposed to take care of!
If you are providing the value as a constant within your code (your -DEFAULT line) then you'll have to use a double apostrophe as I showed above. FOCUS will still keep one internally.
However, when the variable already contains the internal quote because it was either read that way from a file or provided to it as a parameter (your case) then no extra step is required.
As long as you favour coding &VARIABLE.QUOTEDSTRING over '&VARIABLE' FOCUS will take care of the rest.
The Developing Reporting Application manual contains documentation on .QUOTEDSTRING which you'll surely find useful and does a much better job at explaining this matter.