Hi all!

I am dealing with several hundreds of tables spread over multiple schema's in one database. As "schema" is an attribute on the DBDatabase itself I worked around it by creating several empire DBDatabase objects, each containing the required tables per schema (correct?). This works as expected but unfortunately I can not join tables across schemas, means across empire DBDatabases while it is perfectly working SQL. I tried to set "schema" attribute to "null" and including the schema in the tables name e.g. SCHEMA.TABLENAME but empire detects the "." as "illegal" character and the name is quoted, thus the final name becomes "SCHEMA.TABLE" which is rejected by oracle (table not found).
Did I miss something?

If not: a possible workaround might be:

Add a (optional) schema attribute on the DBTable. Due to the fact it is a new attribute and two new methods (setter/getter to the attribute) existing code is not affected.

When generating SQL the existing logic has to be changed to something like this:

String schema = null;
if (null != table.getSchema()) {
    schema = table.getSchema()
} else {
    if (null != database.getSchema()) {
        schema = database.getSchema()
    }
}

// continue with prepending schema before "." + tablename
// addFrom()...


What you think?

(Again)

Jens

Reply via email to