Skip to Content.
Sympa Menu

freetds - Re: [freetds] Are LOBs supported? - Binding before prepare

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Sebastien FLAESCH <sf AT 4js.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Are LOBs supported? - Binding before prepare
  • Date: Thu, 10 Jan 2008 09:16:56 +0100

Frediano Ziglio wrote:
examples you bind parameters after SQLPrepare. I would suggest to bind
before. In many cases (using many drivers) it's faster.
Thanks for the tip, but actually we have to do SQLPrepare() before because
the basic SQL instructions in Informix 4gl are PREPARE, then EXECUTE with
parameter definition and values:

PREPARE s1 FROM "INSERT INTO tab VALUES( ?, ?, ? )" -- SQLPrepare()
EXECUTE s1 USING var1, var2, var3 -- SQLExecute()

...


I would try to prepare before even for Informix. Driver should just not
use binding informations if protocol does not require them. Binding data
is a way to say "take missing data from here" it do not force anything.

If it works (as it should) you will gain performance with drivers that
work better with type informations on prepare.

Maybe I was not clear:

I have *no* SQL paramater type information at prepare time...
So I can't SQLBindParameter() before SQLPrepare()...

I could postpone SQLPrepare() just before SQLExecute(), but then I
would not get SQL Error at prepare time (for example to get "table not
found" errors).
= we do not use deferred prepare.

Anyway thanks for the tip, I keep it in mind.
Seb




Archive powered by MHonArc 2.6.24.

Top of Page