Re: [GENERAL] function and passing the table name to be used with SQL stmnt

2007-10-29 Thread kamiseq
some other question I dont like to make a new topic so I will add it here. I ve modified my function to CREATE OR REPLACE FUNCTION bookid(_tabela varchar) RETURNS integer AS $ $ DECLARE _id integer := 0; BEGIN --insert bez id wyzwala nextwal na tabela_columna_seq EXECUTE 'inser

Re: [GENERAL] function and passing the table name to be used with SQL stmnt

2007-10-29 Thread kamiseq
> SELECT INTO _id id FROM _tabela order by id desc limit 1; ok I ve found that EXECUTE 'SELECT id FROM ' || quote_ident(_tabela) ||' order by id desc limit 1' INTO _id; ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please

[GENERAL] function and passing the table name to be used with SQL stmnt

2007-10-29 Thread kamiseq
ok so my probelm is I have a simple function like this CREATE OR REPLACE FUNCTION bookid(_tabela varchar) RETURNS integer AS $ $ DECLARE _id integer := 0; BEGIN SELECT INTO _id id FROM _tabela order by id desc limit 1; RETURN _id+1; END; $$ LANGUAGE plpgsql; and the problem is i can r