Re: insert ..... returning problem - Mailing list pgsql-general

From Michael Ivanov
Subject Re: insert ..... returning problem
Date
Msg-id 3d7fba5a-aecd-935d-c7ae-8dbfe8a253f7@isle.spb.ru
Whole thread Raw
In response to Re: insert ..... returning problem  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: insert ..... returning problem  (Sándor Daku <daku.sandor@gmail.com>)
Re: insert ..... returning problem  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general
Hallo, no.

I am using postgres c library, namely I'm calling PQexec()

Best regards,

On 24.06.2021 16:14, Laurenz Albe wrote:
> On Thu, 2021-06-24 at 12:31 +0300, Michael Ivanov wrote:
>> 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?
> 
> Are you talking about ECPG?
> 
> Yours,
> Laurenz Albe
> 


-- 
 \   / |                       |
 (OvO) |  Михаил Иванов                    |
 (^^^) |                                   |
  \^/  |      E-mail:  ivans@isle.spb.ru   |
  ^ ^  |                                   |



pgsql-general by date:

Previous
From: Thorsten Schöning
Date:
Subject: How much data does server side "loread" return?
Next
From: Marc Mamin
Date:
Subject: RE: removing "serial" from table definitions.