Insert with bound columns

From: Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Insert with bound columns
Date: 2003-02-06 18:33:24
Message-ID: 3E42AA74.9090606@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Did anybody succeed in inserting empty string columns using bound columns?

INSERT INTO testtab (keyCol, strCol) VALUES (1, '') or (1, NULL)
succeeds, but

INSERT INTO testtab (keyCol, strCol) VALUES (?,?) does not.

I debugged the driver and found that SQLNumParams will return 2 for the
bound column version,which is obviously correct. Unfortunately, MSDASQL
seems to expect 1 (I checked by changing it with debugger), but that
will make the ODBC driver unhappy. I changed the database access class
to replace all empty strings with a one-space string. This made MSDASQL
happy, but will not be reasonable for production.

I'm using native OLEDB, thus MSDASQL is my provider using ODBC 7.2.5
from source.
Feedback from ADO users is welcome, they're using OLEDB implicitely.

I checked MSDN and Technet for this,and traced the output of PGadmin II
which is not using bound columns so it's not helpful to me.

Any hints?

Andreas

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Fred Parkinson 2003-02-06 20:09:53 record locks?
Previous Message Support 2003-02-06 15:43:21 Repost: problem on treatment when add a duplicate primary key