[freetds] Status of support for Time type

Randy Syring rsyring at gmail.com
Fri Aug 16 10:47:08 EDT 2013


Hi Gents,

Can you give me a status update on support for the Time type? After the 
exchange below, the email thread takes a pretty technical turn.  From 
that discussion, it sounds like the Time type is not yet supported in dblib?

Still trying to figure out what to do with this issue:

http://code.google.com/p/pymssql/issues/detail?id=103

Thanks.

*Randy Syring*
Development | Executive Director
Direct: 502.276.0459
Office: 812.285.8766
Level 12 Technologies <https://www.lev12.com/>
/Principled People | Technology that Works/

On 04/30/2013 11:39 PM, James K. Lowden wrote:
> On Tue, 30 Apr 2013 20:05:00 +0100
> Frediano Ziglio <freddy77 at gmail.com> wrote:
>
>> Problem here is also that you are using dblib which is not supposed
>> to be extended!
>>
>> As Microsoft decided to not update it we should find a way to
>> compatibly extend dblib in order to put/get time/date!
> It is easily done, if one has the time.  What needs extending other
> than dbbind() and bcp_bind()?
>
> ISTM dbbind() should support binding a server's DATE or TIME to
> DBDATETIME or DBDATETIM4, subject to domain constraints.  Although
> there are new types, most databases still keep data per the
> Gregorian calendar, and most days are still 24 hours.  Mapping the new
> date & time column types to the existing db-lib structures would allow
> existing programs to use the new column types merely by relinking to a
> newer FreeTDS.
>
> For completeness -- to support new applications using the extended date
> range -- dbbind() would need new structs and new bindings.
>
> For structures I would use those already defined for ODBC.  Microsoft
> defines these, but I don't see support for them in tds_convert()?
>
> struct tagDATE_STRUCT {
>     SQLSMALLINT year;
>     SQLUSMALLINT month;
>     SQLUSMALLINT day;
> } DATE_STRUCT;
>
> struct tagTIME_STRUCT {
>     SQLUSMALLINT hour;
>     SQLUSMALLINT minute;
>     SQLUSMALLINT second;
> } TIME_STRUCT
>
> For binding, dbbind() defines SMALLDATETIBIND and DATETIMEBIND. I would
> suggest adding DATEBIND and TIMEBIND.
>
> Those are needed only for binary bindings, and only if we adopt new
> structs.
>
> Just a small matter of programming.
>
> --jkl
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>



More information about the FreeTDS mailing list