psqlodbc - dayofweek and week functions are not supported butactually are - Mailing list pgsql-odbc

From xsgao@aim.com
Subject psqlodbc - dayofweek and week functions are not supported butactually are
Date
Msg-id 253242280.12504498.1553712195648@mail.yahoo.com
Whole thread Raw
Responses Re: psqlodbc - dayofweek and week functions are not supported butactually are  ("Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>)
List 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

pgsql-odbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: Building libpq independently of server
Next
From: "Inoue, Hiroshi"
Date:
Subject: Re: psqlodbc - dayofweek and week functions are not supported butactually are