pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
psqlodbc - dayofweek and week functions are not supported but actually are
2+ messages / 2 participants
[nested] [flat]

* psqlodbc - dayofweek and week functions are not supported but actually are
@ 2019-03-27 18:43 xsgao@aim.com
  2019-03-29 00:15 ` Re: psqlodbc - dayofweek and week functions are not supported but actually are Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  0 siblings, 1 reply; 2+ messages in thread

From: xsgao@aim.com @ 2019-03-27 18:43 UTC (permalink / raw)
  To: pgsql-odbc

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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: psqlodbc - dayofweek and week functions are not supported but actually are
  2019-03-27 18:43 psqlodbc - dayofweek and week functions are not supported but actually are xsgao@aim.com
@ 2019-03-29 00:15 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  0 siblings, 0 replies; 2+ messages in thread

From: Inoue, Hiroshi @ 2019-03-29 00:15 UTC (permalink / raw)
  To: xsgao@aim.com; +Cc: pgsql-odbc

Hi,

I would take care of the change.
Thanks.

Hiroshi Inoue

On 2019/03/28 3:43, xsgao@aim.com wrote:
> 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


---
このメールは、AVG によってウイルス チェックされています。
http://www.avg.com

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-03-29 00:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-27 18:43 psqlodbc - dayofweek and week functions are not supported but actually are xsgao@aim.com
2019-03-29 00:15 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>

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