[Oledb-dev] timestamp parameters

Ricardo Pardini pardinilist at pardini.net
Thu Sep 1 05:59:48 GMT 2005


Hello list,

    first I wanna thank for PgOleDb. I am experimenting with it and I'm 
very pleased with the results.
    I'm currently working with the CVS codebase (HEAD), compiled and 
working with VC++ 6 and Platform SDK.
    I have a question about timestamp handling; when I do something like

SELECT NOW() AS MYFIELD

    via the ADO/PgOleDb path, I get a valid recordset with a field of 
type 135 (adDBTimeStamp) and NumericScale of 6.
    Essentially, retrieving (from pgsql) date/time/timestamp via PgOleDb 
works without problems; but when I try to do the opposite, that is, send 
a timestamp value to pgsql via parametrized statement, PgOleDb 
complains. One example (excuse my VBScript):

' ... snip connection details, object creation, etc ...
command.CommandText = "select ? as something"
command.Parameters.Append command.CreateParameter("somedate", 
adDBTimeStamp, adParamInput)
command.Parameters.Item("somedate").Value = Now

    When I run something like this, PgOleDb triggers the assertion at 
typeinfo::StdPGWidthInvalid. Last thing on the log before the assertion 
failure is "IAccessorImpl::GetBindings". Right after 'ignoring' the 
assertion failure, I get (in the log):

CErrorLookupService::ClearErrorCPgSession::PQexec 0, "START TRANSACTION 
ISOLATION LEVEL READ COMMITTED"
CPgSession::PQexec 1, "select $1 as something"
CPgSession::PQerrorMessage ERROR:  insufficient data left in message
CPgSession::PQexec error ERROR:  insufficient data left in message

    I suppose that in the current state, PgOleDb is capable of 
converting timestamp values sent from pgsql to the variants we need on 
the application side, but not the opposite, that is, converting valid 
datetime variants to pgsql's timestamp format. I don't even know if that 
is actually possible.  Am I on the right track here? Any pointers would 
be nice.

    Again, thanks for PgOleDb (and PostgreSQL!)

--
Ricardo Pardini

   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3172 bytes
Desc: S/MIME Cryptographic Signature
Url : http://pgfoundry.org/pipermail/oledb-devel/attachments/20050901/522ae884/smime.bin


More information about the Oledb-devel mailing list