Re: FreeTDS does not work with Sybase SQL Anywhere 10, 11 or 12 -- sp_datatype_info()
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAHt6W4fx5BRdBpuhE8+9OVxbJy=vazqWPdohTH8JBCnvC0Jx-A@mail.gmail.com> |
2013/2/6 James K. Lowden <[email protected]>: > On Wed, 6 Feb 2013 17:44:38 +0000 > Tony Esposito <[email protected]> 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