From: xsgao@aim.com
To: pgsql-odbc@postgresql.org
Subject: psqlodbc - dayofweek and week functions are not supported but actually are
Date: Wed, 27 Mar 2019 18:43:15 +0000 (UTC)
Message-ID: <253242280.12504498.1553712195648@mail.yahoo.com> (raw)
References: <253242280.12504498.1553712195648.ref@mail.yahoo.com>
When calling SQLGetInfo(SQL_TIMEDATE_FUNCTIONS), psqlodbc tells that WEEKOFDAY and WEEK are not supported. But in convert.c, it converts these two functions to extrat(dow/week from $1). So if you just send dayofweek() in a query, PostgreSQL will return correct values.
So in this method of info.c:
RETCODE SQL_API
PGAPI_GetInfo(HDBC hdbc,
SQLUSMALLINT fInfoType,
PTR rgbInfoValue,
SQLSMALLINT cbInfoValueMax,
SQLSMALLINT * pcbInfoValue)
You need to append two more bits:
case SQL_TIMEDATE_FUNCTIONS: /* ODBC 1.0 */
len = 4;
value = (SQL_FN_TD_NOW | SQL_FN_TD_DAYOFWEEK | SQL_FN_TD_WEEK );
break;
I am using 10.03.0000.
thanks,Song X. Gao
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: xsgao@aim.com
Subject: Re: psqlodbc - dayofweek and week functions are not supported but actually are
In-Reply-To: <253242280.12504498.1553712195648@mail.yahoo.com>
References: <253242280.12504498.1553712195648.ref@mail.yahoo.com> <253242280.12504498.1553712195648@mail.yahoo.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