[ic] sql-param containing quote char in a value tag

Kevin Walsh interchange-users@icdevgroup.org
Tue Feb 4 08:56:01 2003


Rich Doughty [rich@opusvl.com] wrote:
> 
> i've got code similar to the following:
> 
> [value name="foo" set="[sql-param bar]"]
> 
> all is fine unless bar contains a '"' character eg
> 
> if [sql-param bar] is
> 	21" widescreen
> 
> then
> 	[value name="foo" set="[sql-param bar]"]
> evaluates to
> 	[value name="foo" set="21" widescreen"] - not good
> 
> i'm not sure of the internals of ic but it looks like the sql-param subtag
> is just a straight text replacement, not like a normal tag.
> 
> is there any workaround for this problem?
> 
You could use single quotes:

    [value name="foo" set='[sql-param bar]']

or pipe characters:

    [value name="foo" set=|[sql-param bar]|]

or a temporary scratch:

    [tmpn foo][sql-param bar][/tmpn]
    [value name="foo" set="[scratch foo]"]

or you could use [perl], [sql-calc] or even [sql-filter] etc.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/