I have a large Sybase ASE C/C++ app which I would like to migrate to Postgresql. The application is using the Sybase CT library (nothing complex: simple SQL, few bulk uploads, etc.). Application is built and run on Linux using SYBASE OCS-16.
I'm trying to evaluate if the BabelFish extension can help speed up migration.
The first challenge (in moving from Sybsae) is that the application make extensive use of multi-statement queries to return multi result sets, using dynamically generated Transact-SQL. In few cases, the multi-statement queries use placeholders in the subsequent calls. For example: (this is not real code, but it's similar to the pattern)
declare @a int
select @a = ?
select foo, bar from table1 where key = @a
select x, y from table2 where key = @a and date = ?
...
Quick check has shown that all those constructs are supported by Microsoft T-SQL.
The second challenge is the Sybase CT API. I believe best approach is to use openTDS, which provide the same API as the Sybase, and configure it to use TDS 7.X, which is supported by Babelfish.
Basically: (My application) -> (make CT Calls) -> (freeTDS) -> TDS 7.X -> (Babelfish) -> (Postgresql).
My Questions:
- Has anyone tried this approach for Sybsae->Postgresql.
- Is this approach likely to work ?
- Is freeTDS needed ? Will bablefish talk to a client speaking TDS 5.X (or 4.X) on the babelfish port ?
- Is there a better approach to address this problem ?
In this project, possible to make minor changes to the application (and to freeTDS if needed), but not possible to touch all the code that is issuing CT calls - too many modules - too time consuming - practically not an option.