Re: Quoting issue from ODBC

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Quoting issue from ODBC
Date: 2023-02-08 00:32:52
Message-ID: 2d478ecb-9f4a-6a3a-acde-4a77d47baabf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-odbc

On 2/7/23 17:23, David G. Johnston wrote:
> On Tue, Feb 7, 2023 at 5:20 PM Brad White <b55white(at)gmail(dot)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;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2023-02-08 00:35:58 Re: PostgreSQL
Previous Message David G. Johnston 2023-02-08 00:23:49 Re: Quoting issue from ODBC

Browse pgsql-odbc by date

  From Date Subject
Next Message Brad White 2023-02-08 04:20:58 Re: Quoting issue from ODBC
Previous Message David G. Johnston 2023-02-08 00:23:49 Re: Quoting issue from ODBC