From: Michael Ivanov <ivans@logit-ag.de>
To: pgsql-general@lists.postgresql.org
Subject: insert ..... returning <column> problem
Date: Thu, 24 Jun 2021 12:31:17 +0300
Message-ID: <dc22ae8e-e75e-2e2a-8e93-fe9c79de0c91@logit-ag.de> (raw)
Greetings!
I'm trying to insert a record returning column value using the following query:
INSERT INTO t_load (load_id, load_type) VALUES (:id, :typ) returning load_idx INTO :idx
But when I try to prepare the query I'm getting the following error:
PREPARE p1515544c00000001 AS insert into t_load (load_id, load_type) values ($1, $2) returning load_idx into $3]:
ERROR: syntax error at or near "into" LINE 1: ...ad_id, load_type) values ($1, $2) returning load_idx into $3
^
Why 'into var' is not accepted here?
Best regards,
--
\ / | |
(OvO) | Mikhail Iwanow |
(^^^) | Voice: +7 (911) 223-1300 |
\^/ | E-mail: ivans@logit-ag.de |
^ ^ | |
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ivans@logit-ag.de
Subject: Re: insert ..... returning <column> problem
In-Reply-To: <dc22ae8e-e75e-2e2a-8e93-fe9c79de0c91@logit-ag.de>
References: <dc22ae8e-e75e-2e2a-8e93-fe9c79de0c91@logit-ag.de>
* 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