[freetds] Are LOBs supported? - Binding before prepare

Sebastien FLAESCH sf at 4js.com
Thu Jan 10 03:16:56 EST 2008


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


More information about the FreeTDS mailing list