Hi Guys,

I'm busy with Sybase ASE and things are somewhat unpleasant. I've had
to modify the default Sybase.py driver as it was not targeted
specifically for ASE. I've got a barely working version (the reflect
code returns all tables and columns but not foreign keys or other
constaints). The big problem with Sybase ASE is the really bad join
clause implementation.

If I manually query something like :

SELECT yield_curve_1.yield_curve_name, yield_curve_2.reference_day,
yield_curve_2.yield_curve_name
FROM yield_curve AS yield_curve_2 LEFT OUTER JOIN yield_curve AS
yield_curve_1 ON yield_curve_2.underlying_yield_curve_seqnbr =
yield_curve_1.seqnbr, yield_curve AS yield_curve_3 LEFT OUTER JOIN
yield_curve AS yield_curve_2 ON
yield_curve_3.underlying_yield_curve_seqnbr = yield_curve_2.seqnbr
WHERE yield_curve_3.reference_day >= '2009-12-15' OR
yield_curve_3.yield_curve_name IN ('CURVE1', 'CURVE2')

I get the following error message:
<eb1>Tables 'yield_curve' and 'yield_curve' have same exposed names.
Use correlation names to distinguish them.

which, of course, is bs as I am using aliases.

However if I rewrite the above query as:

SELECT yield_curve_1.yield_curve_name,
        yield_curve_2.reference_day,
        yield_curve_2.yield_curve_name
FROM yield_curve AS yield_curve_2, yield_curve AS yield_curve_1,
yield_curve AS yield_curve_3
WHERE yield_curve_3.underlying_yield_curve_seqnbr *=
yield_curve_2.seqnbr
AND yield_curve_2.underlying_yield_curve_seqnbr *=
yield_curve_1.seqnbr
AND yield_curve_3.reference_day >= '2009-12-15' OR
yield_curve_3.yield_curve_name IN ('CURVE1', 'CURVE2')

It works perfectly - it's the exact same thing as the ANSI - compliant
query but Sybase is quite happy to accept this syntax ( truth be told,
it's actually a lot nicer )

So, apart from getting Sybase to fix this, how do I go about creating
a join dialect for Sybase? I see Oracle's implementation and it seems
fairly involved. Is there a simple way to add T-SQL join syntax to the
Sybase driver ?

Thanks.

--

You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.


Reply via email to