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 1pPYOW-00047z-EA for pgsql-general@arkaria.postgresql.org; Wed, 08 Feb 2023 00:33:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pPYOV-0004vI-3R for pgsql-general@arkaria.postgresql.org; Wed, 08 Feb 2023 00:33:03 +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 1pPYOU-0004ug-Hx for pgsql-general@lists.postgresql.org; Wed, 08 Feb 2023 00:33:02 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pPYOO-0008R7-3m for pgsql-general@lists.postgresql.org; Wed, 08 Feb 2023 00:33:01 +0000 Received: by mail-pl1-x62e.google.com with SMTP id r8so17514731pls.2 for ; Tue, 07 Feb 2023 16:32:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=VjBqhPJHQ3yP4Ypb8Tp1xwIVHwwPFeqILQgNp58j1VA=; b=P3P/tNKlcvO+sC8Fj7XZaHE/NRI9/PIp7HzfyZQngQl8XgB+9DpZnunnddAdxTW3ph oPDzBog4F6T+MXiEWzjypXvTY2M/TuoJeSX5Q8svooDyxhXfctrZcKQt2KAcwEm6sDL5 5gGnx5ueS0UXWxwOZ2gggKz8yoEk5dfs6QdM/+rKhA8X31j+Pmiccj2PTdlsiBG+IVVU bRRafjN1+uCREcp1K56f71hTx9+YL3wOmQ7R11exOjYE2IaMOeQC6BGlkjW//7Oadbyb oj2kXxkcH6L7E1dyUv5bevDKun/GOJWH3qJM5d1ZFsta0q4ASaVtOd8LmG+8cWpxzACT 1gMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=VjBqhPJHQ3yP4Ypb8Tp1xwIVHwwPFeqILQgNp58j1VA=; b=x0MszEbCUfezjxKxxEopFHbjhT3Pju1VKtZdbUorOiyXjXIwLqiWFXVJNH+yddmO94 3WgBPVeTlaaG2FHjpgrN9p7V2lgWt4klFsH7BMKD8RsTjAjixduWrN0PmlxWcb/7GTOe QE1YbQVNATP33V/W/vybHM6pcxO/1/Vrk7jhtJ35kYpAY6W0VCz98IOoZgDaU6UGAh4+ 2liIpHUvVfGgDxfQNBbl5kqypsbzjM4UXlMQfFNhUPJzKNZEg4efqH5y5e5JVReTVXXx EGIqOW4/437JL7v9I459NxHy8tak9Gc3KGanRi7d1Ly7HRNI8fKZGr0CAdhVPB6H9tyv fexg== X-Gm-Message-State: AO0yUKVm9klVwfcM2caJjxJ6dm47OIbFteThPmiwJMnWmA58z7/cv/33 wO3A0B3PpD+elb6kiaATF657Ksd6P0w= X-Google-Smtp-Source: AK7set+g7ega29lGGgJ0OOOySoDWEUhVQ3ZtRaBI8Uy/yOtfVRLdu4y329kw4SlHjWU77CCNkVABPw== X-Received: by 2002:a17:903:234e:b0:198:fdce:8b71 with SMTP id c14-20020a170903234e00b00198fdce8b71mr755739plh.9.1675816374593; Tue, 07 Feb 2023 16:32:54 -0800 (PST) Received: from ?IPV6:2601:681:5a00:f790:80e7:e472:969b:72d3? ([2601:681:5a00:f790:80e7:e472:969b:72d3]) by smtp.gmail.com with ESMTPSA id jh19-20020a170903329300b00194ac38bc86sm9423709plb.131.2023.02.07.16.32.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Feb 2023 16:32:54 -0800 (PST) Content-Type: multipart/alternative; boundary="------------HdBeLDLTqrb1VNeaYJUjyTme" Message-ID: <2d478ecb-9f4a-6a3a-acde-4a77d47baabf@gmail.com> Date: Tue, 7 Feb 2023 17:32:52 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Quoting issue from ODBC Content-Language: en-CA To: pgsql-general@lists.postgresql.org References: From: Rob Sargent In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------HdBeLDLTqrb1VNeaYJUjyTme Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/7/23 17:23, David G. Johnston wrote: > 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. > Should the SET clause have a table alias at all?  I get an error with update foo set foo.id = something; --------------HdBeLDLTqrb1VNeaYJUjyTme Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2/7/23 17:23, David G. Johnston wrote:
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: 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.

Should the SET clause have a table alias at all?  I get an error with
update foo set foo.id = something;



--------------HdBeLDLTqrb1VNeaYJUjyTme--