Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vPfeS-00AiHQ-1V for pgsql-odbc@arkaria.postgresql.org; Sun, 30 Nov 2025 11:31:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vPfeP-00GSaB-2W for pgsql-odbc@arkaria.postgresql.org; Sun, 30 Nov 2025 11:31:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vPfeP-00GSa2-1k for pgsql-odbc@lists.postgresql.org; Sun, 30 Nov 2025 11:31:33 +0000 Received: from pgintl.fastcrypt.com ([149.56.129.164]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vPfeI-002PKD-15 for pgsql-odbc@postgresql.org; Sun, 30 Nov 2025 11:31:27 +0000 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by pgintl.fastcrypt.com (Postfix) with ESMTPSA id 5748520229 for ; Sun, 30 Nov 2025 06:31:25 -0500 (EST) Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-9491604d00fso114732139f.2 for ; Sun, 30 Nov 2025 03:31:25 -0800 (PST) X-Gm-Message-State: AOJu0YzSbK+QlcMnbJbZDnoi4I4PbIWRP3qejdFMELVzFJiCMWOxc4ym oGrRDRdppYvkT9lioV1g+SxVdXgbzxNKh6a42YZYg0IAkCwuraZkBnCVGp343aiSdXB2c6KSRZZ TPGdx8j8fSPC+ulNwastrGkkMKEVF54c= X-Google-Smtp-Source: AGHT+IHbYvKKHG/Rvg3Pnhmt4+y4g8Xcg6pgcg3M6ADJC6RoVwXj+7lq0dV9oyR3trINEy4r4lJyERRr1DPsQqb0Ui4= X-Received: by 2002:a05:6638:2a0a:b0:5b7:d710:661e with SMTP id 8926c6da1cb9f-5b967ace4b3mr20278870173.21.1764502282423; Sun, 30 Nov 2025 03:31:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dave Cramer Date: Sun, 30 Nov 2025 06:31:13 -0500 X-Gmail-Original-Message-ID: X-Gm-Features: AWmQ_bk-LXdynau35zqyRXxQbBu2cECLAJ6MGWq0VB2mDSmR1ZnaxjR5avXYtNk Message-ID: Subject: Re: Catch "RAISE NOTICE" in ODBC application To: Igor Korot Cc: PostgreSQL ODBC list Content-Type: multipart/alternative; boundary="000000000000bfd7ad0644ce3368" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000bfd7ad0644ce3368 Content-Type: text/plain; charset="UTF-8" ChatGPT shows this: SQLGetDiagRec( SQL_HANDLE_STMT, // statement handle hstmt, iRecord, // record number, starting at 1 SqlState, &NativeError, MessageText, BufferLength, &TextLengthPtr ); Notices will have: - SqlState = "00000" - NativeError = 0 - MessageText = "" Dave Cramer www.postgres.rocks On Sun, 30 Nov 2025 at 02:58, Igor Korot wrote: > Hi, ALL, > How do I do that? > > Google showed only the libpq way... > > Thank you. > > > --000000000000bfd7ad0644ce3368 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
ChatGPT shows this:

SQLGetDi= agRec(
=C2=A0 =C2=A0 SQL_HANDLE_STMT, =C2=A0// statement handle
=C2= =A0 =C2=A0 hstmt,
=C2=A0 =C2=A0 iRecord, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0// record number, starting at 1
=C2=A0 =C2=A0 SqlState,
=C2=A0 =C2= =A0 &NativeError,
=C2=A0 =C2=A0 MessageText,
=C2=A0 =C2=A0 Buffer= Length,
=C2=A0 =C2=A0 &TextLengthPtr
);

<= div>

Notices will have:

  • SqlState =3D "00000"

  • NativeError =3D 0

  • MessageText =3D "<your NOTICE text>"

Dave Cramer
www.postgres.rocks


--000000000000bfd7ad0644ce3368--