Subject | RE: [firebird-support] Any UDF or Built in Finction to handle "escaping" single quotes in strings |
---|---|
Author | Sasha Matijasic |
Post date | 2008-08-25T08:47:48Z |
>I'm not sure you need it, but if all you want is to duplicate single quotes use replace.
> Is anyone aware of a simple way of escaping imbedded single quotes in
> strings within a PSQL procedure / trigger (short of writing a UDF)? I
> need to receive a string parameter which then will be processed via
> an "execute statement" and "execute block" combination and so any
> imbedded single quotes need to be duplicated.
>
> (version is Firebird 2.1)
>
> I haven't been able to find anything obvious though it's not the
> easiest thing to search for.
>
select replace('foo''s', '''', '''''') from rdb$database
Sasha