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 1pPYFw-0003fV-S4 for pgsql-general@arkaria.postgresql.org; Wed, 08 Feb 2023 00:24:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pPYFv-0006Dx-Ct for pgsql-general@arkaria.postgresql.org; Wed, 08 Feb 2023 00:24:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pPYFv-0006Do-0c for pgsql-general@lists.postgresql.org; Wed, 08 Feb 2023 00:24:11 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pPYFs-0008MG-Ok for pgsql-general@postgresql.org; Wed, 08 Feb 2023 00:24:10 +0000 Received: by mail-ej1-x636.google.com with SMTP id dr8so47140085ejc.12 for ; Tue, 07 Feb 2023 16:24:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MSXt1F9xBV8tQLJ+wYdTws+2vjx+QynJ8ly2D+iJEtg=; b=SrVRvRzJy7Y0rrUmWxbGBIPeN5fXLuy46pHisSK0t+L4UwFdWXNHoQVRnjRNNT5vny mUdbwsovcdRzqF0C/ynUuGxHYibRojzoPiLZY0uFek18m5bMfIAuFdVnEYQb0AooeSzn 13H4H0/fIP0yLS5uBZh22hRv6aWv832+6gKDpTBRey/nIDE9IKCBiyuCQpdMkKaXpew8 uUQ4ihiFlHW3KniE5IMW/qvpgMrRF9gE/Mq/sqSdYyjkLs10HnCl5B5AmJRt5TmxaYQh wjWQHhMnwj5HD5ibSDFYRFBCAfr7ckTGB2aIU9BufQRyEWTryCZrg3VTm8FjKdJAjNwv RfRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MSXt1F9xBV8tQLJ+wYdTws+2vjx+QynJ8ly2D+iJEtg=; b=sApuBdHuEaB3aeAQK3PbKmOK1J/43rHa26kZ39IU1pL9ZXC1CyqUVChiu9yNMhd/VS ip63kDbgaEVXOHDGE9w+EKnEkumtUhjj2zkbzPsU2Z/ujLX1KSGNuXxAxykQEV8n0+3O uHKuZNXH0e6x4jthisH1N3iKc0kh8WGB/tm1Wue7ZRrtRBhFDgvyEuMV1WmBORK5VH1h 03cRoR9X6eI4QcXSzHWhc0tDUVAhu45lLz2lZ1J1hFMgm3hJ7k4dYb7Izd4/1mw+Ft3O 5iRgv5mQJTVOi5R1drTMu66+GyVd5GVPH411vVCGm37Nf5zZNEPvDjiSkMSMc9/lMkq9 lk+w== X-Gm-Message-State: AO0yUKXmy216xM7qEDBECn/TMRd7UWiYXKUCckKaXu8WgPTN6ecNZ9dD wGAUgdxU+QluYi2vGyZJYn19pVQjkLO4VAiUm9s= X-Google-Smtp-Source: AK7set/odSg/iCm+KijyY1bjzaGh8i6yO4ECKQW2ynrZOmLgB5llPA5nTWaOLPwLWslVCMhusyF/uld4PWm81SKutl4= X-Received: by 2002:a17:906:4d93:b0:887:fa97:1ee5 with SMTP id s19-20020a1709064d9300b00887fa971ee5mr1327315eju.145.1675815847096; Tue, 07 Feb 2023 16:24:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Tue, 7 Feb 2023 17:23:49 -0700 Message-ID: Subject: Re: Quoting issue from ODBC To: Brad White Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="00000000000046768b05f4254817" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000046768b05f4254817 Content-Type: text/plain; charset="UTF-8" On Tue, Feb 7, 2023 at 5:20 PM Brad White wrote: > For example, this is the literal code in VBA > > Access: connection.Execute "UPDATE [" & strTable & "] SET [" & strTable & > "].[InsertFlag] = Null" _ > & " WHERE ((([" & strTable & "].[InsertFlag])=" & lngCurrUID & "));", > , adCmdText Or adExecuteNoRecords > Note that InsertFlag is bracketed the same way in both instances. > > PSQL: UPDATE "public"."Orders" SET InsertFlag=NULL WHERE ("InsertFlag" = > 166 ) > Note that InsertFlag is quoted once but not the other time. > Of course this gives the error: column "insertflag" of relation "Orders" > does not exist at character 35. > > Either VBA is doing some query munging or that concatenated string isn't the one that is producing the error. Which suggests that maybe you have a string somewhere that is not written correctly that need to be fixed so it doesn't produce this error. David J. --00000000000046768b05f4254817 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Feb 7, 2023 at 5:20 PM Brad White <b55white@gmail.com> wrote:
For = example, this is the literal code in VBA

Access:= =C2=A0connection.Execute "UPDATE [" & strTable & "] = SET [" & strTable & "].[InsertFlag] =3D Null" _=C2=A0 =C2=A0 & " WHERE ((([" & strTable & "].[= InsertFlag])=3D" & lngCurrUID & "));", , adCmdText O= r adExecuteNoRecords
Note that InsertFlag is bracketed the same way in = both instances.

PSQL:=C2=A0UPDATE "public"."Or= ders" SET InsertFlag=3DNULL =C2=A0WHERE ("InsertFlag" =3D 16= 6 )
Note that InsertFlag is quoted once but not the other time.
Of course this gives the error: column "insertflag" of r= elation "Orders" does not exist at character 35.


Either VBA is doing so= me query munging or that concatenated string isn't the one that is prod= ucing the error.=C2=A0 Which suggests that maybe you have a string somewher= e that is not written correctly that need to be fixed so it doesn't pro= duce this error.

David J.

--00000000000046768b05f4254817--