pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedDouble-nesting quotes?
2+ messages / 2 participants
[nested] [flat]
* Double-nesting quotes?
@ 2001-04-05 18:48 Josh Berkus <josh@agliodbs.com>
0 siblings, 1 reply; 2+ messages in thread
From: Josh Berkus @ 2001-04-05 18:48 UTC (permalink / raw)
To: pgsql-sql
Folks,
I'm writing some functions that make serious use of the EXECUTE
functionality. However, I need to do some string comparisons inside the
execute statements ... how do I double-nest the single quote marks?
EXAMPLE:
where_string := ''WHERE client_name ~* '''' || s_client || '''';
-Josh Berkus
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Double-nesting quotes?
@ 2001-04-08 23:03 Cedar Cox <cedarc@visionforisrael.com>
parent: Josh Berkus <josh@agliodbs.com>
0 siblings, 0 replies; 2+ messages in thread
From: Cedar Cox @ 2001-04-08 23:03 UTC (permalink / raw)
To: Josh Berkus <josh@agliodbs.com>; +Cc: pgsql-sql
Carefully. :)
Try:
where_string := ''WHERE client_name ~* '''''' || s_client || '''''''';
(I think I got that right.) The way I do it is to write it first as if
I'm not inside a function and not double my single quotes. After I'm
done, go back and double all of them.. you're on you own if you need to
debug!
-Cedar
On Thu, 5 Apr 2001, Josh Berkus wrote:
> Folks,
>
> I'm writing some functions that make serious use of the EXECUTE
> functionality. However, I need to do some string comparisons inside the
> execute statements ... how do I double-nest the single quote marks?
>
> EXAMPLE:
> where_string := ''WHERE client_name ~* '''' || s_client || '''';
>
> -Josh Berkus
>
> ______AGLIO DATABASE SOLUTIONS___________________________
> Josh Berkus
> Complete information technology josh@agliodbs.com
> and data management solutions (415) 565-7293
> for law firms, small businesses fax 621-2533
> and non-profit organizations. San Francisco
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-04-08 23:03 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-05 18:48 Double-nesting quotes? Josh Berkus <josh@agliodbs.com>
2001-04-08 23:03 ` Cedar Cox <cedarc@visionforisrael.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox