From: Byron Nikolaidis <byronn@insightdist.com>
To: Krasnow, Greg <gak@hnc.com>
Cc: pgsql-interfaces <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] VB, RDO, and Parameters
Date: Wed, 27 May 1998 19:03:35 -0400
Message-ID: <356C9BC6.3CC5219A@insightdist.com> (raw)
References: <C162BB3549A5CF118D7400805FD4122401576E6D@pchnc.hnc.com>
Krasnow, Greg wrote:
> Has anyone been able to create Parameterized queries for PostresSQL (using
> PostODBC)?
>
> I have a VB app which works fine for Oracle, Access, DB/2, Informix, etc...
> and I am trying to use it with a postgres database. In the app I have a
> parameter query (i.e. "SELECT ... WHERE fdl1 = ?") I was getting a parse
> error on this from the psotgres engine. I then tried using "SELECT ...
> WHERE fld1 = $1" and am now getting parameter $1 out of range? Has anyone
> out there done anything similar to this?
>
The postgres backend can't handle parameters like this. But, the odbc driver
can. If you create your sql with the parameter markers (?) and then use
SQLBindParameter to supply the parameter values. The driver then replaces the
parameter markers with your parameter data. Access and others do this all the
time and it works great!
Now, as far as VB goes, I'm not sure how SQLBindParameter translates.
Hope this helps.
Byron
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, gak@hnc.com
Subject: Re: [INTERFACES] VB, RDO, and Parameters
In-Reply-To: <356C9BC6.3CC5219A@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