Received: from www.la-rubber.com (unknown [216.31.142.3]) by postgresql.org (Postfix) with ESMTP id C380747589B for ; Wed, 10 Jul 2002 15:46:23 -0400 (EDT) Received: from la-rubber.com (server [127.0.0.1]) by www.la-rubber.com (8.11.6/8.11.6) with SMTP id g6AJxOe08115 for ; Wed, 10 Jul 2002 12:59:24 -0700 Received: from 10.1.1.39 (SquirrelMail authenticated user ddurst) by www.la-rubber.com with HTTP; Wed, 10 Jul 2002 12:59:24 -0700 (PDT) Message-ID: <1220.10.1.1.39.1026331164.squirrel@www.la-rubber.com> Date: Wed, 10 Jul 2002 12:59:24 -0700 (PDT) Subject: Insert Function From: "David Durst" To: X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal X-Mailer: SquirrelMail (version 1.2.5) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200207/144 X-Sequence-Number: 8523 Is there anyway to create a insert function? I am trying: CREATE FUNCTION add_user(varchar(20),varchar(20),varchar(20),int4,int4) RETURNS int4 AS 'INSERT INTO usr (user_name,first_name,last_name,permission_set_id,customer_id) values ($1,$2,$3,$4,$5)' language 'sql'; and get: ERROR: function declared to return integer, but final statement is not a SELECT I thought that a insert would return a internal row #, but I am not sure about this. Thanks, David Durst MIS Manager www.la-rubber.com