Skip site navigation (1) Skip section navigation (2)

[ psqlodbc-Bugs-1010745 ] ODBC Interval data types are not implemented natively

From: <noreply(at)pgfoundry(dot)org>
To: noreply(at)pgfoundry(dot)org
Subject: [ psqlodbc-Bugs-1010745 ] ODBC Interval data types are not implemented natively
Date: 2009-12-30 17:27:59
Message-ID: 20091230172759.08F7E107202B@pgfoundry.org (view raw or flat)
Thread:
Lists: pgsql-odbc
Bugs item #1010745, was opened at 2009-12-30 12:27
You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1010745&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Farid Zidan (faridz)
Assigned to: Nobody (None)
Summary: ODBC Interval data types are not implemented natively

Initial Comment:
PostgreSQL ANSI ODBC driver 8.04.01.00 does not implement ODBC interval data types. Example,

create table TEST_INTERVAL (
   INTERVALOID          SERIAL               not null,
   COL1                 INTERVAL month       null,
   COL2                 interval year        null,
   COL3                 interval year to month null,
   COL4                 interval day         null,
   COL5                 interval day to hour null,
   COL6                 interval day to minute null,
   COL7                 interval day to second(0) null,
   COL8                 interval day to second null,
   COL9                 interval hour        null,
   COL10                interval hour to minute null,
   COL11                interval hour to second(0) null,
   COL12                interval hour to second null,
   COL13                interval minute      null,
   COL14                interval minute to second(0) null,
   COL15                interval minute to second null,
   COL16                interval second(0)   null,
   COL17                interval second      null,
   COL18                interval second(3)   null,
   constraint PK_TEST_INTERVAL primary key (INTERVALOID)
);

I get the following data type information from SQLColAttribute when describing the resultset for select * from test_interval 
for SQL_DESC_TYPE_NAME and SQL_DESC_CONCISE_TYPE:

serial	SQL_INTEGER
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR
unknown(2000)	SQL_VARCHAR

I should be getting the data type name and the following ODBC data types
SQL_INTEGER
SQL_INTERVAL_MONTH
SQL_INTERVAL_YEAR
SQL_INTERVAL_YEAR_TO_MONTH
SQL_INTERVAL_DAY
SQL_INTERVAL_DAY_TO_HOUR
SQL_INTERVAL_DAY_TO_MINUTE
SQL_INTERVAL_DAY_TO_SECOND
SQL_INTERVAL_DAY_TO_SECOND
SQL_INTERVAL_HOUR
SQL_INTERVAL_HOUR_TO_MINUTE
SQL_INTERVAL_HOUR_TO_SECOND
SQL_INTERVAL_HOUR_TO_SECOND
SQL_INTERVAL_MINUTE
SQL_INTERVAL_MINUTE_TO_SECOND
SQL_INTERVAL_MINUTE_TO_SECOND
SQL_INTERVAL_SECOND
SQL_INTERVAL_SECOND
SQL_INTERVAL_SECOND

So I can bind the interval columns to SQL_C_INTERVAL target and then use
SQLColAttribute SQL_DESC_PRECISION and
SQLGetDescField SQL_DESC_DATETIME_INTERVAL_PRECISION to get/set the column leading field and trailing field precision per ODBC spec
http://msdn.microsoft.com/en-us/library/ms716251(VS.85).aspx



----------------------------------------------------------------------

You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1010745&group_id=1000125

pgsql-odbc by date

Next:From: noreplyDate: 2009-12-30 17:30:16
Subject: [ psqlodbc-Bugs-1010745 ] ODBC Interval data types are not implemented natively
Previous:From: Hiroshi InoueDate: 2009-12-30 06:19:07
Subject: psqlODBC 08.04.0200 Released

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group