Re: Insert with bound columns

Поиск
Список
Период
Сортировка
Искать
От
Andreas Pflug
Тема
Re: Insert with bound columns
Дата
Msg-id
3E42DA23.1060405@web.de
Ответ на
Список
Дерево обсуждения
Re: Insert with bound columns Hiroshi Inoue <Inoue@tpf.co.jp>
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

В списке pgsql-odbc по дате отправления
От: Fred Parkinson
Дата:
Сообщение: record locks?
От: Hiroshi Inoue
Дата:
Сообщение: Re: Insert with bound columns
FAQ