Re: [GENERAL] plpgsql syntax error

2011-10-13 Thread József Kurucz
Many Thanks!!! It works! Regards, Josef 2011/10/10 Ondrej Ivanič : > Hi, > > On 10 October 2011 21:35, József Kurucz wrote: >> ERROR:  syntax error at or near "$1" >> LINE 1: create table  $1  ( ) >>                      ^ >> QUERY:  create table  $1  ( ) >> CONTEXT:  SQL statement in PL/PgSQL

Re: [GENERAL] plpgsql syntax error

2011-10-10 Thread Adrian Klaver
On Monday, October 10, 2011 3:35:27 am József Kurucz wrote: > Hi, > > I'm beginner in postgresql and plpgsql and i have the following problem. > I'm trying to check a table if exists or not and when not exists then > create it, but I get a syntax error. > > Here is my code: > > > create or repl

Re: [GENERAL] plpgsql syntax error

2011-10-10 Thread Ondrej Ivanič
Hi, On 10 October 2011 21:35, József Kurucz wrote: > ERROR:  syntax error at or near "$1" > LINE 1: create table  $1  ( ) >                      ^ > QUERY:  create table  $1  ( ) > CONTEXT:  SQL statement in PL/PgSQL function "check_table" near line 22 I think you have to use "execute": execute

[GENERAL] plpgsql syntax error

2011-10-10 Thread József Kurucz
Hi, I'm beginner in postgresql and plpgsql and i have the following problem. I'm trying to check a table if exists or not and when not exists then create it, but I get a syntax error. Here is my code: create or replace function check_table() returns void as $$ DECLARE mmonth integer; yyear in