On 11-Jun-2014 14:12 -0500, Koester, Michael wrote:

On 11-Jun-2014 13:29 -0500, CRPence wrote:
On 11-Jun-2014 12:43 -0500, Koester, Michael wrote:
This SQL View is created from joining a physical file with a
couple other views. I verified from the joblog that the
dependent views had been successfully restored prior to the
attempt to restore the problem view. Incidentally, the other five
views (two of which join to another view) restored without

When a VIEW is created the /statement text/ is maintained in the
*FILE object and in the catalogs. When the VIEW is restored to a
new library, the qualified table-references must be updated to
reflect the new schema [library] name.

I don't know if "nonqualified" table names would need to be updated
or not, but for the most part we don't qualify in our source code. We
rely on the library list for that, and that is the case here.

Irrespective of qualification for table-references [e.g. references on the FROM clause, irrespective of TABLE vs VIEW] on the original DDL CREATE VIEW, the Database SQL stores originally [and will also update the /statement text/ as required; e.g. for RNMOBJ, MOVOBJ, RSTOBJ, and ??] to show the _fully qualified names_ that should *always* accurately reflect the current definition.

A review of either\both of the "SQL view create statement" in the Display File Description (DSPFD) output and the VIEW_DEFINITION column data in the SYSVIEWS SQL Catalog VIEW [from the data in the column DBXDFN of the System Database Cross-Reference file QADBXREF in QSYS] for any VIEW would show the qualified name [using dot-naming aka SQL-naming].

For example, if I issue the following [first] line of DDL CREATE VIEW statement below while System-naming is in effect, then the output of a DSPFD will appear as shown in the next line, and the output of a query of the catalog via SELECT VIEW_DEFINITION FROM SYSVIEWS WHERE NAME='MYFEAT' will appear as shown in the next line:

create view QGPL/MYFEAT as select * from SYSFEATURE



This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page