Insert Function - Mailing list pgsql-sql

From David Durst
Subject Insert Function
Date
Msg-id 1220.10.1.1.39.1026331164.squirrel@www.la-rubber.com
Whole thread Raw
Responses Re: Insert Function  (Ian Barwick <barwick@gmx.net>)
List pgsql-sql
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




pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: BETWEEN bug?
Next
From: Stephan Szabo
Date:
Subject: Re: BETWEEN bug?