Re: Obtaining hundredths of a second data from time data types

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Scott Ferrett <scott(at)ferrettconsulting(dot)com>, pgsql-odbc(at)postgresql(dot)org
Subject: Re: Obtaining hundredths of a second data from time data types
Date: 2016-03-04 18:19:45
Message-ID: 56D9D1C1.4060506@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On 03/03/2016 10:39 PM, 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?

So does is show the tenths and/or the fields after the hundredths?

Can you show the results of the SELECT query?

>
> Cheers,
> Scott Ferrett
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Scott Ferrett 2016-03-04 21:20:16 Re: Obtaining hundredths of a second data from time data types
Previous Message Scott Ferrett 2016-03-04 07:07:26 SQLDescribeCol not returning correct information for time fields