I think my original posting of this question may have gotten overlooked,
since I added it to the bottom of a different problem resolution.  I'm
putting it in it's own thread.

I'm trying to connect to one schema and then access a table in another. 
Using a metadata object from the schema I'm connected to and doing this:

import sqlalchemy as sa

db = sa.create_engine( 'mysql://user:[EMAIL PROTECTED]/sysconfig' )
md = sa.BoundMetaData( db )

t = sa.Table( 'connection_log', md, schema='sys', autoload=True )

print t.select()

Gives this error:

sqlalchemy.exceptions.SQLError: (ProgrammingError) (1146, "Table
'sysconfig.connection_log' doesn't exist") 'describe connection_log' {}

Changing the Table() call to this:

t = sa.Table( 'sys.connection_log', md, autoload=True, schema='sys' )


makes the describe table work, but generates the following SQL:

SELECT `sys.connection_log`.log_id, `sys.connection_log`.comment
FROM sys.`sys.connection_log`


You can see it's trying to get the correct schema in the FROM clause,
but the table name is (obviously) wrong.

What am I doing wrong?  I'm using SQLAlchemy-0.2.8 and python 2.4.3.

Thanks,
e.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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