Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] Odbc parser error

From: Byron Nikolaidis <byronn(at)insightdist(dot)com>
To: Sferacarta Software <sferac(at)bo(dot)nettuno(dot)it>
Cc: pgsql-interfaces(at)postgreSQL(dot)org, "pgsql-hackers(at)hub(dot)org" <pgsql-hackers(at)hub(dot)org>
Subject: Re: [INTERFACES] Odbc parser error
Date: 1998-09-17 20:33:31
Message-ID: 3601721B.B2493AA3@insightdist.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces

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



In response to

Responses

pgsql-hackers by date

Next:From: Billy G. AllieDate: 1998-09-17 23:37:22
Subject: Re: [HACKERS] Re: [INTERFACES] Odbc parser error
Previous:From: Bruce MomjianDate: 1998-09-17 19:44:38
Subject: Re: [HACKERS] yacc problems

pgsql-interfaces by date

Next:From: Mark D. SeeleyDate: 1998-09-17 20:45:52
Subject: RE: [INTERFACES] psqlodbc bug or something else?
Previous:From: Mark D. SeeleyDate: 1998-09-17 18:29:05
Subject: RE: [INTERFACES] psqlodbc bug or something else?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group