in reply to Re^2: DB2 / Multiple schemas in a query or command
in thread DB2 / Multiple schemas in a query or command

talexb:

I don't know if DB2 allows insertable views or not. But if so, you could make some views from the most-used schema to the objects in the lesser-used ones, bypassing the issue...

use food create view food.orchard as select * from trees.orangeTrees select A.apples, B.oranges from fruitSalad A join orchard B on A.compareKey = B.compareKey
...roboticus

Replies are listed 'Best First'.
Re^4: DB2 / Multiple schemas in a query or command
by talexb (Chancellor) on Dec 16, 2008 at 14:46 UTC

    Interesting idea, thanks. I haven't really considered creating more DB2 views since I'm relatively new to DB2 (well, I think PostgreSQL has them as well, but since I'm not a full-time DBA, I get lazy), but that might be an approach to consider. I've already discovered db2expln and I'm a regular visitor to IBM Boulder's DB2 web site with on-line documentation, so that's definitely something to consider.

    My goal is to 'de-complicate' the source code, and I'm trying to do that by conflating some of the routines into fewer, slightly smarter routines; by simplifying the SQL that's used; and by grouping related routines into their own modules, rather than have a couple of monster modules that get pulled into just about every script.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      In Oracle, we've created synonyms to views in other schemas. I don't know if DB2 has the same thing, if not, then views would work too.