Received: from u1.abs.net (root@u1.abs.net [207.114.0.131]) by hub.org (8.8.8/8.8.8) with ESMTP id SAA20216 for ; Thu, 17 Sep 1998 18:15:52 -0400 (EDT) (envelope-from byronn@insightdist.com) Received: from insightdist.com (root@localhost) by u1.abs.net (8.9.0/8.9.0) with UUCP id SAA04987 for pgsql-hackers@hub.org; Thu, 17 Sep 1998 18:01:46 -0400 (EDT) Received: from ceodev by insightdist.com (AIX 3.2/UCB 5.64/4.03) id AA38526; Thu, 17 Sep 1998 16:33:52 -0400 Received: from byronn by ceodev (AIX 4.1/UCB 5.64/4.03) id AA42956; Thu, 17 Sep 1998 16:33:51 -0400 Message-Id: <3601721B.B2493AA3@insightdist.com> Date: Thu, 17 Sep 1998 16:33:31 -0400 From: Byron Nikolaidis X-Mailer: Mozilla 4.05 [en] (Win95; I) Mime-Version: 1.0 To: Sferacarta Software Cc: pgsql-interfaces@postgreSQL.org, "pgsql-hackers@hub.org" Subject: Re: [INTERFACES] Odbc parser error References: <8440.980917@bo.nettuno.it> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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