Re: syntax error during function call - Mailing list pgsql-general

From Sam Mason
Subject Re: syntax error during function call
Date
Msg-id 20100127170721.GY5407@samason.me.uk
Whole thread Raw
In response to syntax error during function call  ("Aycock, Jeff R." <JEFF.R.AYCOCK@saic.com>)
List pgsql-general
On Wed, Jan 27, 2010 at 10:40:17AM -0500, Aycock, Jeff R. wrote:
> EXECUTE 'SELECT *, $1, now() INTO schema_1.'||whoami||' FROM schema_2.'||whoami||' where created_dt between $2 and
$3;'

You'll also need to expand those other parameters.  The code is executed
in an independent scope and hence PG doesn't know what $1, $2 or $3 are.

The builtin function "quote_literal" is probably best to use here,
especially for the TEXT type.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: syntax error during function call
Next
From: "Aycock, Jeff R."
Date:
Subject: Re: syntax error during function call