On Dec 12, 2007, at 9:04 AM, King Simon-NFHD78 wrote:

>
> Hi,
>
> I'm connecting to an ancient version of MySQL (3.23.58) that (as far  
> as
> I can tell) doesn't support basic "JOIN <table> ON <condition>" syntax
>
> Ie. this gives a syntax error:
>
>  SELECT * FROM productversions pv
>  JOIN producttypes pt ON pv.producttype = pt.producttype
>
> Whereas this is fine:
>
>  SELECT * FROM productversions pv
>  JOIN producttypes pt
>  WHERE pv.producttype = pt.producttype
>
> Can anyone think of anything I can do (perhaps by subclassing or
> monkeypatching MySQLDialect) to automatically convert queries like the
> former into the latter? SQLAlchemy seems to be infitely flexible in
> dealing with syntax quirks of various databases, so I've got my  
> fingers
> crossed...
>

this is possible, we do it in the oracle module when the ansi=False  
flag is set.  if you look at the visit_join code in oracle.py, you  
could probably lift that up and stick it right in mysql.py, have it  
activated by a dialect flag, and it would work.

however, if the database doesnt support JOIN..ON, that indicates that  
its impossible to do an OUTER JOIN.    oracle used a special operator  
(+) to indicate the "outerness" of a join..does this old mysql have  
anything for that ?   otherwise it doesnt seem much worth it to  
support JOIN at all when you could just select from two tables.

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

Reply via email to