pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Quoting issue from ODBC
Date: Tue, 7 Feb 2023 17:32:52 -0700
Message-ID: <2d478ecb-9f4a-6a3a-acde-4a77d47baabf@gmail.com> (raw)
In-Reply-To: <CAKFQuwZv0ZtOa+NiZP1E+C-B+EPQCieZ-UJtcReXWUETrOsqSA@mail.gmail.com>
References: <CAA_1=93z4oEXKQ9GHtDkEQhEe5r39C8YSDMpwO8OHmSBreXw3g@mail.gmail.com>
	<CAA_1=91rYvL1Z3LetskQJKvxZwhiyxuU0KEG8giQLg4B=VbSUA@mail.gmail.com>
	<CAKFQuwZv0ZtOa+NiZP1E+C-B+EPQCieZ-UJtcReXWUETrOsqSA@mail.gmail.com>

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;

view thread (14+ messages)  latest in thread

Message-ID: <2d478ecb-9f4a-6a3a-acde-4a77d47baabf@gmail.com>
Permalink:  ../2d478ecb-9f4a-6a3a-acde-4a77d47baabf@gmail.com/
Also on:    postgresql.org/message-id/2d478ecb-9f4a-6a3a-acde-4a77d47baabf@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com
  Subject: Re: Quoting issue from ODBC
  In-Reply-To: <2d478ecb-9f4a-6a3a-acde-4a77d47baabf@gmail.com>
  References: <CAA_1=93z4oEXKQ9GHtDkEQhEe5r39C8YSDMpwO8OHmSBreXw3g@mail.gmail.com> <CAA_1=91rYvL1Z3LetskQJKvxZwhiyxuU0KEG8giQLg4B=VbSUA@mail.gmail.com> <CAKFQuwZv0ZtOa+NiZP1E+C-B+EPQCieZ-UJtcReXWUETrOsqSA@mail.gmail.com> <2d478ecb-9f4a-6a3a-acde-4a77d47baabf@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox