On Feb 13, 4:23 pm, Paul Johnston <[EMAIL PROTECTED]> wrote:
> Hi,
>
> >I'm wondering where I can specify that the tables that I want are in
> >the schema DataTables instead of 'dbo'. The engine.echo outuput shows
>
> It's an argument to Table() e.g.
>
> ke_contracts = Table('KEContracts', sa.metadata,
> autoload=True, schema="DataTables")

The error when I do this is:

<!-- ~/Documents/DataProc/Development/data/source/KE_Agreements
tbrannon --> ./proc.py
conn_url mssql://perl2:[EMAIL PROTECTED]:1433/DATA
Traceback (most recent call last):
  File "./proc.py", line 8, in <module>
    sa = data.config.db.sqlalchemy()
  File "/Users/tbrannon/Documents/DataProc/Development/data/config/
db.py", line 10, in __init__
    self.engine = create_engine(conn_url, schema=schema)
  File "build/bdist.macosx-10.4-i386/egg/sqlalchemy/engine/
__init__.py", line 91, in create_engine
  File "build/bdist.macosx-10.4-i386/egg/sqlalchemy/engine/
strategies.py", line 86, in create
TypeError: Invalid argument(s) 'schema' sent to create_engine(), using
configuration PyMSSQLDialect/QueuePool/Engine.  Please check that the
keyword arguments are appropriate for this combination of components.
<!-- ~/Documents/DataProc/Development/data/source/KE_Agreements
tbrannon -->

---------------------------------------------------------------------------------------------

The code is this:

class sqlalchemy:

    def __init__(self, ip="24.129.182.44", db="DATA",
schema="DataTables"):
        conn_url = "mssql://perl2:[EMAIL PROTECTED]:1433/%s" % (ip, db)
        print "conn_url", conn_url
        self.engine = create_engine(conn_url, schema=schema)
        self.engine.echo=True
        self.metadata = BoundMetaData(self.engine)



>
> >sqlalchemy.exceptions.NoSuchTableError: KEContracts
>
> Were you expecting this error?

Well KEContracts is in the DataTables schema, so, until I specify that
as the schema, it wont be able to find it....

I'm wondering if you can make the schema argument blank and simply
make the table schema-qualified?


--~--~---------~--~----~------------~-------~--~----~
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