Re: insert ... returning in plpgsql - Mailing list pgsql-general

From Leif Biberg Kristensen
Subject Re: insert ... returning in plpgsql
Date
Msg-id 201210021506.32502.leif@solumslekt.org
Whole thread Raw
In response to insert ... returning in plpgsql  (Willy-Bas Loos <willybas@gmail.com>)
List pgsql-general
 Tirsdag 2. oktober 2012 15.01.08 skrev Willy-Bas Loos :
> Hi,
> (postgres 9.1)
> I was doing something like this in a plpgsql function, but i got a Syntax
> Error.
>
> t_var:=(insert into table1(field2) values ('x') returning field1);
>
> Is there no support for using RETURNING in insert, update, delete queries
> to fill a variable in plpgsql?

Try

insert into table1(field2) values ('x') returning field1 into t_var

regards, Leif


pgsql-general by date:

Previous
From: Willy-Bas Loos
Date:
Subject: insert ... returning in plpgsql
Next
From: Cédric Villemain
Date:
Subject: Re: insert ... returning in plpgsql