Hello,
I have a function with three parameters that would populate a table in
one schema from another table of the same name in another schema. The
tables are dynamically selected at execution time.
CREATE OR REPLACE FUNCTION schema_1.getAllSnapShot(user_id text,
begin_dt date, end_dt
On 27/01/2010 15:40, Aycock, Jeff R. wrote:
BEGIN
FOR r IN SELECT * FROM schema_1.snapshot_table
LOOP
DECLARE whoami text := r;
I could be wrong, but I don't think that the DECLARE inside the loop is
correct. I think you have to declare whoami with the rest of
To: Aycock, Jeff R.
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] syntax error during function call
On 27/01/2010 15:40, Aycock, Jeff R. wrote:
BEGIN
FOR r IN SELECT * FROM schema_1.snapshot_table
LOOP
DECLARE whoami text := r;
I could be wrong, but I
ERROR: syntax error at or near (
LINE 1: SELECT *, $1, now() INTO schema_1.(table_A) FROM schema_2.(table_A)
where created_dt between $2 and $3;
schema_1.(table_A) is nonsense. have to be schema_1.table_A
regards
Pavel Stehule
--
Sent via pgsql-general mailing list
here though.
Thanks for the suggestion, however.
Regards,
Jeff Aycock
-Original Message-
From: Pavel Stehule [mailto:pavel.steh...@gmail.com]
Sent: Wednesday, January 27, 2010 11:13 AM
To: Aycock, Jeff R.
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] syntax error during
On 01/27/2010 08:27 AM, Aycock, Jeff R. wrote:
Pavel,
Per your suggestion I modified one line below BEGIN to look like this:
EXECUTE 'SELECT *, $1, now() INTO schema_1.'||whoami||' FROM
schema_2.'||whoami||' where created_dt between $2 and $3;'
However, it is still giving me the same syntax
Aycock, Jeff R. jeff.r.ayc...@saic.com wrote:
Pavel,
Per your suggestion I modified one line below BEGIN to look like this:
EXECUTE 'SELECT *, $1, now() INTO schema_1.'||whoami||' FROM
schema_2.'||whoami||' where created_dt between $2 and $3;'
] syntax error during function call
On 01/27/2010 08:27 AM, Aycock, Jeff R. wrote:
Pavel,
Per your suggestion I modified one line below BEGIN to look like this:
EXECUTE 'SELECT *, $1, now() INTO schema_1.'||whoami||' FROM
schema_2.'||whoami||' where created_dt between $2 and $3;'
However
On 01/27/2010 08:41 AM, Aycock, Jeff R. wrote:
Adrian,
I tried that as well and got the same error result.
Regards,
Jeff Aycock
I went back to the original function and assuming no cut/paste errors
there is a ';' missing after the last END.
END;
RETURN NEXT r;
Thanks for the catch.
However, this did not fix the syntax error.
-Original Message-
From: Adrian Klaver [mailto:adrian.kla...@gmail.com]
Sent: Wednesday, January 27, 2010 11:47 AM
To: Aycock, Jeff R.
Cc: Pavel Stehule; pgsql-general@postgresql.org
Subject: Re: [GENERAL] syntax error
On 01/27/2010 08:50 AM, Aycock, Jeff R. wrote:
Thanks for the catch.
However, this did not fix the syntax error.
You are sure the function is being replaced with versions that have the
changes? In other words does \df+ show the changes?
--
Adrian Klaver
adrian.kla...@gmail.com
--
Sent
On 01/27/2010 08:50 AM, Aycock, Jeff R. wrote:
Thanks for the catch.
However, this did not fix the syntax error.
Looking back at this thread I second Andreas's suggestion. It seems the
syntax is right but the names are wrong. What is the result when you do
SELECT * FROM
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
-
From: Osvaldo Kussama [mailto:osvaldo.kuss...@gmail.com]
Sent: Wednesday, January 27, 2010 11:57 AM
To: Aycock, Jeff R.
Subject: Re: [GENERAL] syntax error during function call
2010/1/27 Aycock, Jeff R. jeff.r.ayc...@saic.com:
Hello,
I have a function with three parameters that would
14 matches
Mail list logo