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 1kd6hV-0003er-Bf for pgsql-general@arkaria.postgresql.org; Thu, 12 Nov 2020 07:07:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kd6hU-0003fR-99 for pgsql-general@arkaria.postgresql.org; Thu, 12 Nov 2020 07:07:20 +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 1kd6hU-0003fJ-1d for pgsql-general@lists.postgresql.org; Thu, 12 Nov 2020 07:07:20 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kd6hR-0006OC-K4 for pgsql-general@lists.postgresql.org; Thu, 12 Nov 2020 07:07:19 +0000 Received: from [178.254.11.41] (helo=r314251-amd64) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kd6hM-0005f7-JR; Thu, 12 Nov 2020 08:07:12 +0100 Date: Thu, 12 Nov 2020 08:07:10 +0100 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: ECPG sqlca error handling Message-ID: <20201112070710.GA18127@r314251-amd64> Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 8.0-CURRENT (i386) User-Agent: Mutt/1.8.0 (2017-02-23) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 178.254.11.41 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, The documentation explains well how to use the 'sqlca' for error handling: https://www.postgresql.org/docs/13/ecpg-errors.html#ECPG-SQLCA An error message is stored in sqlca.sqlerrm.char sqlerrmc[SQLERRMC_LEN]. My question is: Is there some way to get the exact failing ESQL/C statement, because only the line number does not help in our case. Thanks in advance matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub Без книги нет знания, без знания нет коммунизма (Влaдимир Ильич Ленин) Without books no knowledge - without knowledge no communism (Vladimir Ilyich Lenin) Sin libros no hay saber - sin saber no hay comunismo. (Vladimir Ilich Lenin)