Received: from mail.belbone.be (mail.belbone.be [195.13.1.3]) by postgresql.org (Postfix) with ESMTP id 814CA475BD4 for ; Wed, 24 Jul 2002 14:11:27 -0400 (EDT) Received: from belbone.be ([213.181.59.250]) by mail.belbone.be (8.12.5/8.12.5) with ESMTP id g6OIBRqU012517 for ; Wed, 24 Jul 2002 20:11:27 +0200 (MET DST) Message-ID: <3D3EFBB1.9040904@belbone.be> Date: Wed, 24 Jul 2002 20:10:41 +0100 From: Wim User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010914 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Trying to write a function... Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200207/389 X-Sequence-Number: 8767 Hello, I'm trying to write a function that add new rows to a table, but I don't succeed..... It's something like this: CREATE FUNCTION f_addrtr (varchar(16),varchar(32)) RETURNS bool AS ' DECLARE index int4; BEGIN index := 'nextval('s_routerid')'; INSERT INTO t_routers VALUES (index, $1, $2); RETURN 1; END;' LANGUAGE 'plpgsql'; What am I doing wrong? Cheers! Wim.