Focal Point
[SOLVED] How to enclose a column name with single quotes

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

November 05, 2014, 06:59 PM
Rejoice
[SOLVED] How to enclose a column name with single quotes
I am trying to add single quotes to a field name as shown below. However, no value is passed on to the target procedure. Please advise

TYPE=DATA,
COLUMN=sub_cnt,
COLOR=BLUE,
TARGET=_BLANK,
FOCEXEC=xxxx.fex (
CTRY_LIST=country.QUOTEDSTRING)

This message has been edited. Last edited by: <Kathryn Henning>,


Webfocus 8
Windows, All Outputs
November 05, 2014, 10:12 PM
njsden
.QUOTEDSTRING can only be applied to Dialogue Manager's &variables, not to actual table or hold file fields.

Why do you want to add quotes to it? the notation CTRY_LIST=country should build a proper URL for your drill-down hyperlink.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
November 06, 2014, 07:36 AM
MartinY
If you need, for any reasons, your country list enclosed between quotes, I suggest to add them in your drill-down fex which is receiving the value in an amper variable.

-*FEX : xxxx.fex

-SET &CTRY_LIST = &CTRY_LIST.QUOTEDSTRING;



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
November 06, 2014, 10:16 AM
j.gross
quote:
-SET &CTRY_LIST = &CTRY_LIST.QUOTEDSTRING;

Actually, that does nothing. The .QUOTEDSTRING implies .EVAL, and the assignment strips off the enclosing quotes, so net-net you're left with the original value.

Code:
-DEFAULT &z1 = O'Realy & O'Reily ;
-SET &z2 = &z1.QUOTEDSTRING ;
-SET &z3 = '''' | &z1.QUOTEDSTRING | '''' ;
-? &z

Result:
CURRENTLY DEFINED & VARIABLES STARTING WITH 'z':
 &z1           = O'Realy & O'Reily
 &z2           = O'Realy & O'Reily
 &z3           = 'O'Realy & O'Reily'



- Jack Gross
WF through 8.1.05
November 06, 2014, 02:16 PM
Rejoice
Thank you! It's now working. I made a change in the target procedure.

-*FEX : xxxx.fex
-* This procedure is used by other reporting applications
-*
-* CTRY_LIST can have multiple alphanumeric values (comma delimited and enclosed in quotes)
-*

-DEFAULT &CTRY_LIST ='FOC_NONE';

-SET &CTRY_LIST_X = IF &SOURCE_CODE = 'Fex1' THEN '''' || &CTRY_LIST || '''' ELSE &CTRY_LIST;

ENGINE SQLPSTGR SET DEFAULT_CONNECTION ServiceMetrics
SQL SQLPSTGR PREPARE COUNTRY_TXNS FOR
select distinct c.country,
sum(transaction_cnt) as country_cnt
from country_rollup sdc
join geo.countries c on sdc.country_code = c.iso2
where 1 =1
and c.country in (&CTRY_LIST_X)
group by
country
) foo

END


Webfocus 8
Windows, All Outputs