Re: [SQL] Function and insert

2002-11-27 Thread Richard Huxton
On Wednesday 27 Nov 2002 11:05 am, Laurent Patureau wrote: > 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 fun

[SQL] Function and insert

2002-11-27 Thread Laurent Patureau
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 --