Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS does not work with Sybase SQL Anywhere 10, 11 or 12 -- sp_datatype_info()

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeTDS does not work with Sybase SQL Anywhere 10, 11 or 12 -- sp_datatype_info()
  • Date: Wed, 6 Feb 2013 21:44:46 +0000

2013/2/6 James K. Lowden <jklowden AT freetds.org>:
> On Wed, 6 Feb 2013 17:44:38 +0000
> Tony Esposito <Tony.Esposito AT region10.org> wrote:
>
>> FreeTDS needs to not be dependent on that sp in order for it to be
>> used with SQL Anywhere. Just need to find out what it does.
>>
>> Otherwise, FreeTDS only works with Sybase ASE.
>
> Tony, if you're willing to do some legwork, I think we can solve this
> together.
>
> The attached file implements the resultset returned by sp_datatype_info
> in C as an array of struct. The data come from SQL Server 2005. If
> you extend the array for SQL Anywhere, we can reference it in
> SQLGetTypeInfo().
>
> The inputs to SQLGetTypeInfo() are:
>
> 1. server product version (implicitly, from connection)
> 2. datatype manifest constant
> 3. ODBC version
>
> We can implement tds_datatype_info() as a binary search of the above
> array using those inputs. If the function fails, we can fall back to
> calling sp_datatype_info on the server. (The local binary search will
> be very fast, microseconds at most.) If both fail, the function
> fails.
>
>> I would see this as a limitation to the product.
>
> I would, too, if FreeTDS were a product. Since it's a project, the
> only real limitation is our own time, skill, and imagination.
>
> Regards,
>
> --jkl
>
I found this

http://www.sqlines.com/sybase-asa-to-oracle/datatypes

types seem quite similar. The "problems" are:
- DATETIMEOFFSET
- VARBIT/LONG VARBIT
- UNIQUEIDENTIFIER

Other types (even XML) have descriptions in TDS protocol.
We can do something: if SQL Anywhere is detected (who to do it??)
return a sort of fixed type (as James suggested) based also from
information from capabilities.

Frediano




Archive powered by MHonArc 2.6.24.

Top of Page