Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwPC2-0001hh-90 for pgsql-general@arkaria.postgresql.org; Thu, 24 Jun 2021 13:14:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwPC1-000685-8I for pgsql-general@arkaria.postgresql.org; Thu, 24 Jun 2021 13:14:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwPC0-00067w-RH for pgsql-general@lists.postgresql.org; Thu, 24 Jun 2021 13:14:52 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lwPBx-0005Uz-1Y for pgsql-general@lists.postgresql.org; Thu, 24 Jun 2021 13:14:51 +0000 Received: by mail-ed1-x534.google.com with SMTP id i5so8511971eds.1 for ; Thu, 24 Jun 2021 06:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=/HxwZR1EX70Vq4q95/DHALAwde4AHQX2x8R25UlBbu8=; b=nOxI2MO32vNHllP1D24MBMotokzwNGUJzqUW8rDcrKvw97PXz/R9KVTzRDvyPnPJ73 3bQBkU0DO0MxvWEZWmM7vDZD03apvUxWO8fnVHtizKO9WaKk7G7B2C0zk9vU+v5GW5h7 Xf4LjvzVg9r7Wmdf9zTfR1Hp7GObotL28mgzQwcFod7JO49P9rUEZAc8Ajk/VIXVUrQt 66YQaoj6qsqmNhqf3EsuHqP0FPjJLBZLS6ZScdnLkc7NAYOumfgH13mhl2/m7rWmuHrk fLQiXZvJePWarTiwu2vxhjefvxaFhkzVyVDXdsdSFq/snid1IaedJTFdNANQSkJQUZAb 8lpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=/HxwZR1EX70Vq4q95/DHALAwde4AHQX2x8R25UlBbu8=; b=O8Jne7FqczQThRRzyPzHWZXqCwzsLUOA+O45Ubj14c+A+Jp47RmYK+acFFgmAaH/o9 yRqQghFFUGPEVaCdUhMX5DMjcCiXmgQrsJMCuSP2b7PXXR2tSN1yRoN3rcSCJ945fuLj tL0VVmloJ/h5CmEIKBhfXwXE+B9vstwRSj8b9d0kRvCFT9K60q1Ap+b0MTxyOcOq7Mki 8ksvYD9iO+L5pUbLlF7eUd+ZZtfcKWjAcIM+1NiH8qrgorGNimfiEuTZ/VUElS2/nJqZ Qo50Dp8V1VhsjumLkNMq1Oasv4lMsnyzxo0zLxg7vCYJyn9KJIptbQkog6cdnQbVHbwf 2sIA== X-Gm-Message-State: AOAM5328hRJHkcQivBp/DaLwFZgRX03AT3O5jhhEoGBM+tYjwwwb9z0U fRKiQae8CsmseYTj+qVTSgvDAg== X-Google-Smtp-Source: ABdhPJwTA6DY7OUEZsOJqi80yA4i/p2w980SJZZERMnpbGVkOgNnHtz11ygKyph1hFFhKkiuH3v0AA== X-Received: by 2002:a05:6402:42d2:: with SMTP id i18mr7043638edc.168.1624540488085; Thu, 24 Jun 2021 06:14:48 -0700 (PDT) Received: from localhost.localdomain (217-149-170-197.nat.highway.telekom.at. [217.149.170.197]) by smtp.gmail.com with ESMTPSA id m7sm1840117edc.46.2021.06.24.06.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 06:14:47 -0700 (PDT) Message-ID: <55a5f85f533342d6b4ae4f518a8a29f1f261ce45.camel@cybertec.at> Subject: Re: insert ..... returning problem From: Laurenz Albe To: Michael Ivanov , pgsql-general@lists.postgresql.org Date: Thu, 24 Jun 2021 15:14:47 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 -- Cybertec | https://www.cybertec-postgresql.com