Re: Support for SQL_SS_TIME2 / SQL_SS_TIME2_STRUCT

Sebastien FLAESCH <[email protected]> Sat, 27 Jan 2018 19:03:00 +0100
Newsgroups gmane.comp.db.tds.freetds
Organization Four Js Development Tools
Message-ID <[email protected]>
On 01/27/2018 06:46 PM, Frediano Ziglio wrote:
> 2018-01-25 13:55 GMT+00:00 Sebastien FLAESCH <[email protected]>:
>> Hi all,
>>
>> I need to know what is the status of SQL_SS_TIME2 / SQL_SS_TIME2_STRUCT
>> support in 1.00
>>
>> I am using 1.00.15 for now.
>>
>> When binding an SQL Parameter with this structure to insert a TIME(N) value,
>> I get the following error:
>>
>> SQLState = HY003
>> Message  = [FreeTDS][SQL Server]Program type out of range
>>
>> Is this structure/type properly supported?
>>
>> Where can I find some code example?
>>
>> What needs to be set in the C type, precision and scale in
>> SQLBindParameter() ?
>>
>> Thanks!
>> Seb
> 
> Hi,
>    I though was implemented!
> 
> But I just tested master and is not.
> Weird... there's some handling for SQL_SS_TIME2 from C to TDS but then
> the conversion fails as the conversion is not available in libTDS!
> 
> Frediano
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> https://lists.ibiblio.org/mailman/listinfo/freetds
> 

Thanks for looking at this Frediano!

 From my tests (I have installed 1.00.80 now):

It appears that SQL_SS_TIME2 / SQL_SS_TIME2_STRUCT can be used in SQLBindCol() but not
with SQLBindParameter...

One can use SQL_C_CHAR / SQL_VARCHAR to pass time data with SQLBindParameter().
However, for consistency, it would be nice to support SQL_SS_TIME2 / SQL_SS_TIME2_STRUCT
also in SQLBindParameter().

Seb