pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Ferrett <scott@ferrettconsulting.com>
To: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Obtaining hundredths of a second data from time data types
Date: Wed, 9 Mar 2016 11:34:28 +1100
Message-ID: <56DF6F94.2080901@ferrettconsulting.com> (raw)
In-Reply-To: <56DEC77D.8040508@dream.email.ne.jp>
References: <56D92DAB.9010806@ferrettconsulting.com>
	<56DEC77D.8040508@dream.email.ne.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

Hi Hiroshi,

This driver fixes all the problems with retrieving data.  Thank you.

This allowed me to get further with my testing and found the next problem.

Although you can now retrieve data using SQLBindCol, you cannot insert 
of update data using SQLBindParameter.

If you issue an INSERT INTO TestTable (ID,T) VALUES (?,?) and use 
SQLBindParameter to bind an SQL_C_TIMESTAMP structure to the second 
parameter, then the new row is inserted with the fractional part truncated.

Cheers,
  Scott

On 08/03/2016 23:37, Inoue, Hiroshi wrote:
> Hi Scott,
>
> Could you try the test drivers 9.5.0104 at
> http://www.ne.jp/asahi/inocchichichi/entrance/psqlodbc/
> ?
>
> regards,
> Hiroshi Inoue
>
> On 2016/03/04 15:39, Scott Ferrett wrote:
>> I am using PostgreSQL 9.5 and the 32bit PostgreSQL ODBC Driver(ANSI)  
>> version 9.05.01.00 on Windows.
>>
>> Given a table with the following create script:
>> create table TestTable( id integer, ts    timestamp,ts0 
>> timestamp(0),ts1   timestamp(1),ts2   timestamp(2),ts3 
>> timestamp(3),ts4   timestamp(4),ts5   timestamp(5),ts6 timestamp(6),t 
>> time,t0    time(0),t1    time(1),t2    time(2),t3 time(3),t4    
>> time(4),t5    time(5),t6    time(6),ExtraInfo char(10),constraint 
>> TestTable_PrimaryKey primary key  (id))
>>
>> I issue the following INSERT statement:
>>
>> INSERT INTO TestTable (id, ts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, t, 
>> t0, t1, t2, t3, t4, t5, t6) VALUES (1, '2001-12-24 01:11:11.111111', 
>> '2001-12-24 01:11:11', '2001-12-24 01:11:11.1', '2001-12-24 
>> 01:11:11.11', '2001-12-24 01:11:11.111', '2001-12-24 01:11:11.1111', 
>> '2001-12-24 01:11:11.11111', '2001-12-24 01:11:11.111111', 
>> '01:11:11.111111', '01:11:11', '01:11:11.1', '01:11:11.11', 
>> '01:11:11.111', '01:11:11.1111', '01:11:11.11111', '01:11:11.111111')
>>
>> I issue a  "SELECT * from TestTable" using SQLExecDirect.  I use 
>> SQLBindCol to bind the timestamp and time fields to SQL_C_TIMESTAMP 
>> data structures.  I then use SQLFetch to retrieve the data.  The 
>> timestamp fields return the hundredths of a second information 
>> correctly, but the time fields all return 0 for the hundredths of a 
>> second.  How can I get the hundredths of a second values for the time 
>> fields using the PostgreSQL ODBC Driver?
>>
>> Cheers,
>>  Scott Ferrett
>
>



-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



view thread (12+ messages)  latest in thread

Message-ID: <56DF6F94.2080901@ferrettconsulting.com>
Permalink:  ../56DF6F94.2080901@ferrettconsulting.com/
Also on:    postgresql.org/message-id/56DF6F94.2080901@ferrettconsulting.com

 · 

reply

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: scott@ferrettconsulting.com, h-inoue@dream.email.ne.jp
  Subject: Re: Obtaining hundredths of a second data from time data types
  In-Reply-To: <56DF6F94.2080901@ferrettconsulting.com>
  References: <56D92DAB.9010806@ferrettconsulting.com> <56DEC77D.8040508@dream.email.ne.jp> <56DF6F94.2080901@ferrettconsulting.com>

* 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