Background: iSeries version of DB2. In every environment, there is a table containing positional column information about other tables. As the data in this table is static and has to be re-generated every time a table is altered, problems can occur if it is out of step.
All the positional data exists in QSYS2.SYSTABLES and QSYS2.SYSCOLUMNS, so it should be possible to create a view that contains the same information but is guaranteed to be correct. Old programs should then be able to use this view.
The only issue is that the view would need to be aware of the current schema (data library in iSeries speak), to retrieve the right information from the QSYS2 tables, as they contain data for all schemas/libraries.
Any ideas on whether this is possible and if so how?
EDIT: Re: Ryan Guill
Effectively I want to the view to select rows in QSYS2.SYSCOLUMNS using the current library name in its criteria. If I have table T in multiple libraries, then SYSCOLUMNS will have data for instances of the T in each library.
An inelegant solution is that I could store the library/schema name in each library, and the view would use this value in the selection...