[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetds
Subject:    Re: [freetds] FreeTDS does not work with Sybase SQL Anywhere 10, 11 or 12 -- sp_datatype_info()
From:       Frediano Ziglio <freddy77 () gmail ! com>
Date:       2013-02-06 21:44:46
Message-ID: CAHt6W4fx5BRdBpuhE8+9OVxbJy=vazqWPdohTH8JBCnvC0Jx-A () mail ! gmail ! com
[Download RAW message or body]

2013/2/6 James K. Lowden <jklowden@freetds.org>:
> On Wed, 6 Feb 2013 17:44:38 +0000
> Tony Esposito <Tony.Esposito@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
_______________________________________________
FreeTDS mailing list
FreeTDS@lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic