pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wim <wdh@belbone.be>
To: pgsql-sql@postgresql.org
Subject: Trying to write a function...
Date: Wed, 24 Jul 2002 20:10:41 +0100
Message-ID: <3D3EFBB1.9040904@belbone.be> (raw)

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.




view thread (2+ messages)

Message-ID: <3D3EFBB1.9040904@belbone.be>
Permalink:  ../3D3EFBB1.9040904@belbone.be/
Also on:    postgresql.org/message-id/3D3EFBB1.9040904@belbone.be

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: wdh@belbone.be
  Subject: Re: Trying to write a function...
  In-Reply-To: <3D3EFBB1.9040904@belbone.be>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox