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      [EMAIL PROTECTED]
>    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
> 


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

Reply via email to