pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Byron Nikolaidis <byronn@insightdist.com>
To: Sferacarta Software <sferac@bo.nettuno.it>
Cc: pgsql-interfaces@postgreSQL.org, "pgsql-hackers@hub.org" <pgsql-hackers@hub.org>
Subject: Re: [INTERFACES] Odbc parser error
Date: Thu, 17 Sep 1998 16:33:31 -0400
Message-ID: <3601721B.B2493AA3@insightdist.com> (raw)
References: <8440.980917@bo.nettuno.it>



Sferacarta Software wrote:

> Hi all,
>
> Seems that ODBC driver have some problems while it translate Access
> commands.
> I created a form with a subform joined by two columns.
>
> after the Access Addnew event, log file returns the following error:
> -----------------------------------------------------------------------
> conn=75511800, query='SELECT "risanamento"."oid" FROM "risanamento" WHERE (("distretto" =  '' ) AND ("progressivo" =  NULL ) ) '
> ERROR from backend during send_query: 'ERROR:  parser: parse error at or near "null"'
> STATEMENT ERROR: func=SC_execute, desc='', errnum=1, errmsg='Error while executing the query'
> ------------------------------------------------------------------------
> NB: Note that parser translate ("progressivo" =  NULL) instead of
> ("progressivo" IS NULL).
>
>

Yes, the NULL works for parameters of an update statement, where Access would specify a statement such as "update table set param =
? where x = 1".  But it doesn't work in a select statement.  I don't think I have much to work with here.  The statement comes in as
something like "select * from table where x = ?".  I have to replace the ? with something.  On updates, 'NULL' works fine.

I'm not sure what to do about this.  On other dbms, parameter passing is handled through a separate protocol to the backend, usually
after a prepare statement, so on these its no problem to send a null, or large amounts of ascii/binary data, without having to worry
about direct substitution into the sql string or hitting the upper limit of the statement string.  I think until Postgres has such
as protocol for parameter substitution/passing, it will be difficult to fix this problem.

Any suggestions?

Byron





view thread (8+ messages)  latest in thread

Message-ID: <3601721B.B2493AA3@insightdist.com>
Permalink:  ../3601721B.B2493AA3@insightdist.com/
Also on:    postgresql.org/message-id/3601721B.B2493AA3@insightdist.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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: byronn@insightdist.com, sferac@bo.nettuno.it, pgsql-hackers@hub.org
  Subject: Re: [INTERFACES] Odbc parser error
  In-Reply-To: <3601721B.B2493AA3@insightdist.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