I'm running into a very strange problem when I attempt to reflect against 
my Oracle DB. I've already pinged the IRC channel, and asked a question on 
StackOverflow. I'm pasting that question verbatim below. If you need 
anything else, please let me know.

I'm attempting to reverse engineer an existing Oracle schema into some 
declarative SQLAlchemy models. My problem is that when I use 
[`MetaData.reflect`](http://docs.sqlalchemy.org/en/rel_0_7/core/schema.html?highlight=metadata.reflect#sqlalchemy.schema.MetaData.reflect),
 
it doesn't find the tables in my schema, just a Global Temp Table. However, 
I can still query against the other tables.

I'm using SQLAlchemy 0.7.8, CentOS 6.2 x86_64, python 2.6, cx_Oracle 5.1.2 
and Oracle 11.2.0.2 Express Edition. Here's a quick sample of what I'm 
talking about:

    >>> import sqlalchemy
    >>> engine = 
sqlalchemy.create_engine('oracle+cx_oracle://user:pass@localhost/xe')
    >>> md = sqlalchemy.MetaData(bind=engine)
    >>> md.reflect()
    >>> md.tables
    immutabledict({u'my_gtt': Table(u'my_gtt', 
MetaData(bind=Engine(oracle+cx_oracle://user:pass@localhost/xe)), 
Column(u'id', NUMBER(precision=15, scale=0, asdecimal=False), 
table=<my_gtt>), Column(u'parent_id', NUMBER(precision=15, scale=0, 
asdecimal=False), table=<my_gtt>), Column(u'query_id', NUMBER(precision=15, 
scale=0, asdecimal=False), table=<my_gtt>), schema=None)})
    >>> len(engine.execute('select * from my_regular_table').fetchall())
    4

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/R82MUKGDQ9AJ.
To post to this group, send email to sqlalchemy@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