Re: [SQL] Correct Insert SQL syntax?

2008-09-04 Thread Ruben Gouveia
Thanks Yuri! On Thu, Sep 4, 2008 at 3:49 PM, Yura Gal <[EMAIL PROTECTED]> wrote: > There is no internal dual table in PG unlike Ora:) If you need to > invoke non-set-returning function simply execute: > > SELECT my_func(p1, p2...); > > -- > Best regards, Yuri. >

Re: [SQL] Correct Insert SQL syntax?

2008-09-04 Thread Yura Gal
There is no internal dual table in PG unlike Ora:) If you need to invoke non-set-returning function simply execute: SELECT my_func(p1, p2...); -- Best regards, Yuri. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/ma

[SQL] Correct Insert SQL syntax?

2008-09-04 Thread Ruben Gouveia
Will this syntax work: fcn_stats are all in the same schema CREATE OR REPLACE FUNCTION insert_stats(p_date date) RETURNS void AS $$ BEGIN insert into stats ( date, stats1, stats2

Re: [SQL] Dynamic SQL Syntax help please

2008-09-04 Thread Ruben Gouveia
thank you Sergio. I decided to use EXECUTE v_stmt into v_total_pop; On Thu, Sep 4, 2008 at 2:00 PM, Ivan Sergio Borgonovo <[EMAIL PROTECTED]>wrote: > On Thu, 4 Sep 2008 13:41:16 -0700 > "Ruben Gouveia" <[EMAIL PROTECTED]> wrote: > > > I created a simple function that i want to use another func

Re: [SQL] Dynamic SQL Syntax help please

2008-09-04 Thread Ivan Sergio Borgonovo
On Thu, 4 Sep 2008 13:41:16 -0700 "Ruben Gouveia" <[EMAIL PROTECTED]> wrote: > I created a simple function that i want to use another function > (in the same schema) that will be used to create a sql statement. > I get the following error when i try this: > > *ERROR: syntax error at or near "EXE

[SQL] Dynamic SQL Syntax help please

2008-09-04 Thread Ruben Gouveia
I created a simple function that i want to use another function (in the same schema) that will be used to create a sql statement. I get the following error when i try this: *ERROR: syntax error at or near "EXEC" at character 1 QUERY: EXEC SQL EXECUTE $1 INTO $2 CONTEXT: SQL statement in PL/P

Re: [SQL] Syntax help please

2008-09-04 Thread Ruben Gouveia
I can't believe myself. It always comes down to some missing semicolon. Thanks for your help. I am embarrassed. On Thu, Sep 4, 2008 at 12:49 PM, Fernando Hevia <[EMAIL PROTECTED]>wrote: > You seem to be missing a ';' in this line: > >v_from := c_from ; >v_where := p_where

Re: [SQL] Syntax help please

2008-09-04 Thread Fernando Hevia
You seem to be missing a ';' in this line: v_from := c_from ; v_where := p_where<--- missing ; here v_stmt := c_select || v_from || v_where; Regards, Fernando De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombr

[SQL] Syntax help please

2008-09-04 Thread Ruben Gouveia
I can't for the life of me figure out what's wrong with this syntax. I get the following error when i try and create this function. *ERROR: syntax error at or near "$2" at character 15 QUERY: SELECT $1 $2 := $3 || $4 || $5 CONTEXT: SQL statement in PL/PgSQL function "fcn_gen_statement