Re: [SQL] Insert Function

2002-07-10 Thread Ian Barwick
On Wednesday 10 July 2002 23:04, David Durst wrote: > I am not sure what the end select does, so if you can give me a explination > it would be apreciated It is there to satisfy the requirement that the function should return a value from a select statement: "12.2. Query Language (SQL) Functions

Re: [SQL] Insert Function

2002-07-10 Thread Ian Barwick
On Wednesday 10 July 2002 21:59, David Durst wrote: > 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 > (

[SQL] Insert Function

2002-07-10 Thread David Durst
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 dec