From: Andreas Pflug <Andreas.Pflug@web.de>
To: pgsql-odbc@postgresql.org
Subject: Re: Insert with bound columns
Date: Thu, 06 Feb 2003 22:56:51 +0100
Message-ID: <3E42DA23.1060405@web.de> (raw)
In-Reply-To: <3E42AA74.9090606@web.de>
References: <3E42AA74.9090606@web.de>
After experimenting heavily, I found out some more.
MSDASQL doesn't like a NULL-pointer as string in the buffer to be
written. Instead, a SysAllocString(L"") is needed. This is acceptable,
if an zero length string should be inserted. If the status field of the
buffer ist not set to DBSTATUS_S_OK indicating valid data to be written,
but to DBSTATUS_S_ISNULL for a NULL to be inserted, MSDASQL will fail
with "Parameter type cannot be determined for at leas one variant
parameter". Actually, it's no variant given, but a DBTYPE_BSTR, and this
information is put correctly into the DBBINDING structure. Still, I
believe ADO users should be unable to insert a NULL string into a
VARCHAR column (if not omitted in the query).
The same (OLEDB side) code works with SQLSRV32, and MSDASQL blows as
soon as it gets to know the number of parameters, so it seems that for
SQLSRV32 MSDASQL can determine the parameter type from the SQL server
driver, but not with PostgreSQL. Does this switch on a light for
anybody, saying "ah now I know what SQLxxyy is for"? If pointed towards
some topic, I could try to implement it.
Regards,
Andreas
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: Andreas.Pflug@web.de
Subject: Re: Insert with bound columns
In-Reply-To: <3E42DA23.1060405@web.de>
References: <3E42AA74.9090606@web.de> <3E42DA23.1060405@web.de>
* 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