pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurent Patureau <lpatureau@idfr.net>
To: pgsql-sql@postgresql.org
Subject: Function and insert
Date: Wed, 27 Nov 2002 12:05:11 +0100
Message-ID: <5.0.0.25.0.20021127120232.00c69aa0@pop.noos.fr> (raw)


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





view thread (2+ messages)  latest in thread

Message-ID: <5.0.0.25.0.20021127120232.00c69aa0@pop.noos.fr>
Permalink:  ../5.0.0.25.0.20021127120232.00c69aa0@pop.noos.fr/
Also on:    postgresql.org/message-id/5.0.0.25.0.20021127120232.00c69aa0@pop.noos.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lpatureau@idfr.net
  Subject: Re: Function and insert
  In-Reply-To: <5.0.0.25.0.20021127120232.00c69aa0@pop.noos.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox