Re: insert ... returning in plpgsql

From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: insert ... returning in plpgsql
Date: 2012-10-02 13:06:32
Message-ID: 201210021506.32502.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Cédric Villemain 2012-10-02 13:13:10 Re: insert ... returning in plpgsql
Previous Message Willy-Bas Loos 2012-10-02 13:01:08 insert ... returning in plpgsql