On Sep 21, 2012, at 12:03 PM, Michael Bayer <
mik...@zzzcomputing.com> wrote:
>
> how are these tables represented in the default schema of that database connection? if they are referred to via oracle synonyms, then they don't exist there as tables, they're in some other schema.
>
> The Oracle dialect features a helper called "oracle_resolve_synonyms", which will cause the dialect to resolve a synonym-named table, but that only works within the Table() call itself, that is, Table("somename", autoload=True, oracle_resolve_synonyms=True). Right now the metadata.reflect() call does not make use of the "resolve_synonyms" feature.
>
> So assuming this is what's going on, you'd need to specify the schema where the tables are actually present, such as:
>
> md.reflect(schema="mytables")
>
> when you do that, you'll get Table objects back which will include "mytables" as the "schema" argument. When these Table objects are used, you'll see the schema explicitly referenced, that is, "select * from myschema.mytable".
The tables are created via simple `CREATE TABLE` statements executed by the user in question. Unless somebody has done something very tricky that I don't know about, no synonyms whatsoever are in use. I also tried `md.reflect(schema='user')` and got the same result. I also tried connecting as a system-level user and specifying the schema argument, on the theory that maybe the user who created the tables lacked some obscure Oracle privilege required for reflection to do its thing; that didn't work, either.
I suppose it's possible I have some weird edge case with configuration weirdness, because I haven't been able to reproduce with an isolated test case. Do you suppose you could give me a 50,000 ft. view of what the reflect() command does on the SQL side of things? That way I can try to dig in against the legacy schema where I'm seeing the problem.
I expect I'll be lurking in #sqlalchemy on Freenode for most of the day, as well.
Thanks a lot for the great tool, and the help.
--Hank