From: Ken J. Wright <ken@ori-ind.com>
To: Teulings, Tim <Tim.Teulings@materna.de>
To: 'pgsql-interfaces@postgresql.org' <pgsql-interfaces@postgreSQL.org>
Subject: Re: AW: [INTERFACES] Postgres (NT), ODBC and DBTools
Date: Wed, 03 Nov 1999 07:33:43 -0800
Message-ID: <3.0.1.32.19991103073343.00aeea20@ori-ind.com> (raw)
In-Reply-To: <23B6DB75C598D111872B00C04F9BF00185C5B4@ntexc1mat.Materna.D E>
>After looking at it again, I'm not sure if it is a problem with the
>colon. The "?" in the statement looks supicious (itis near the
>'where'
>stated in the error message). AFAIK ODBC does allow binding of
>variables
>(bind variable, bound expresion) and DBTools uses this. Is the "?"
>legal
>at this point (it references the value bound to a variable) or is it
>a
>error?
The '?' is fine but it's not getting replaced with the real value. The
stmt_with_params string in the log is the actual string sent to the backend
after parsing. I'm just guessing at the flag values, but it appears to me
that there was not a "Prepare" statement in your code after assigning the
sql string, and before assigning the parameter value. I'm not familiar with
DBTools, so I don't know how it handles prepares. Normally it would go
something like:
(pseudo code)
stmt.sql = 'select foo from bar where it = ?'
stmt.prepare
stmt.setparam(1,'avalue')
stmt.execute
Ken
>ERROR from backend during send_query: 'ERROR: parser: parse error at
>or near "where"'
> hdbc=25902376, stmt=26161368, result=0
> manual_result=0, prepare=1, internal=0
> bindings=0, bindings_allocated=0
> parameters=25897048, parameters_allocated=1
> statement_type=2, statement='UPDATE CXMgl SET
>RowVersion = 2, Vorname = ? WHERE RowVersion = 1 AND MglID = 2776'
> stmt_with_params='UPDATE CXMgl SET RowVersion = 2,
>Vorname = ? WHERE RowVersion = 1 AND MglID = 2776'
> data_at_exec=-1, current_exec_param=-1, put_data=0
> currTuple=-1, current_col=-1, lobj_fd=-1
> maxRows=0, rowset_size=1, keyset_size=0,
>cursor_type=0, scroll_concurrency=1
> cursor_name='SQL_CUR018F30D8'
> ----------------QResult Info
>- -------------------------------
>CONN ERROR: func=SC_execute, desc='', errnum=110, errmsg='ERROR:
>parser: parse error at or near "where"'
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: ken@ori-ind.com, Tim.Teulings@materna.de
Subject: Re: AW: [INTERFACES] Postgres (NT), ODBC and DBTools
In-Reply-To: <3.0.1.32.19991103073343.00aeea20@ori-ind.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