Function and insert

From: Laurent Patureau <lpatureau(at)idfr(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Function and insert
Date: 2002-11-27 11:05:11
Message-ID: 5.0.0.25.0.20021127120232.00c69aa0@pop.noos.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hi,

I want to do a function that insert a row on a table like :

CREATE FUNCTION ajout_secu(INT4) RETURNS OID
AS 'INSERT INTO test_2 VALUES($1);'
LANGUAGE 'SQL';

PG refuse to accept the type returns oid as the function is not a SELECT.
What can I do ?

thanks for your help,

LP

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2002-11-27 12:23:12 FreeBSD, Linux: select, select count(*) performance
Previous Message Tilo Schwarz 2002-11-27 10:13:40 Re: Question on SQL and pg_-tables