2009/2/11 Clovis Fabricio <[email protected]>:
> 2009/2/10 Michael Bayer <[email protected]>:
>>> Question is: How can I do that in a sa.Table constructor?
>>> sa.Table('DataB.dbo.TableInB', metadata, ....)
>>> sa.Table('TableInB', metadata, ...., schema='DataB.dbo')
>>> And both failed. Is there a way to map tables from both databases
>>> using the same engine? So I can do a JOIN between the tables?
>> you should use the "schema" argument. Define "failed" ?
> Now it works. I was doing something wrong. Sorry for the trouble, and thank
> you.
No sorry! it is still failing, I though it was working because
declaration didn't yield any errors. But when using it in a query I
got the error:
>>> tb = sa.Table('TableInB', metadata, ...., schema='DataB.dbo')
>>> print tb.insert()
INSERT INTO [DataB.dbo].[TableInB] ([field1], [field2]) VALUES (?, ?)
It should be "[DataB].[dbo].[TableInB]"
I got it to work by using:
sa.Table('DataB.dbo.TableInB', metadata, ...., quote=False)
or
sa.Table('TableInB', metadata, ...., schema='DataB].[dbo')
but both are damn ugly!!
Thanks in advance
nosclo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---