Option V. Views

The Views (ADB21VV) panel displays information from the Db2® catalog about views, including whether the view uses multiple tables in different databases or table spaces. To display this panel, select option V on the System Catalog (ADB21) panel.

The following figure shows an example of this panel:

Figure 1. Views (ADB21VV) panel
ADB21VV in --------------- DB2 Views                      - Row 1 to 18 of 563 
                                                                               
Commands: GRANT MIG UTIL ALL                                                       
Line commands:                                                                 
 C - Columns  A - Auth  L - List  S - Table space  D - Database   
 T - Tables  Y - Synonyms  SEL - Select prototyping  DDL - Show DDL    
 ? - Show all line commands                                   
                 
                                                              Number of    
Sel   Name               Schema   C DB Name  TS Name    Cols     Tables   
      *                  *        * *        *             *          *     
----- ------------------ -------- - -------- -------- ------ ----------     
      VDEPT              DSN81010 N DSN8D10A DSN8S10D      4          1     
      VHDEPT             DSN81010 N DSN8D10A DSN8S10D      5          1     
      VEMP               DSN81010 N DSN8D10A DSN8S10E      5          1     
      VPROJ              DSN81010 N DSN8D10A DSN8S10P      8          1     
      VACT               DSN81010 N DSN8D10A DSN8S10P      3          1     
      VPROJACT           DSN81010 N DSN8D10A ++++++++      5          2     
      VEMPPROJACT        DSN81010 N DSN8D10A DSN8S10P      6          1     
      VCONA              DSN81010 N DSN8D10P DSN8S10C      5          2     
      VOPTVAL            DSN81010 N DSN8D10P DSN8S10C     11          1     
      VDSPTXT            DSN81010 N DSN8D10P DSN8S10C      3          1     
      VDEPMG1            DSN81010 N ++++++++ ++++++++      7          4     
      VEMPDPT1           DSN81010 N DSN8D10A DSN8S10D      7          1     
      VASTRDE1           DSN81010 Y DSNDB06  SYSTSTAB     13          1     
      VASTRDE2           DSN81010 N DSN8D10A DSN8S10E     13          1     
      VPROJRE1           DSN81010 N DSN8D10A DSN8S10P      8          1     
      VPSTRDE1           DSN81010 N DSNDB06  SYSTSTAB     12          1     
      VPSTRDE2           DSN81010 N DSNDB06  SYSTSTAB     12          1     
      VFORPLA            DSN81010 N DSN8D10A DSN8S10P      7          1     
Command ===>                                                  Scroll ===> PAGE 

Use line commands to show all Db2 objects on which the view depends and any dependent views (a view of a view).

Columns

This panel displays the following columns:

Sel
Input field where you can enter one of the line commands listed on the panel. Enter a question mark (?) on a row to view all valid line commands.
Name
Name of the view.
Schema
Schema of the view.
C
Indication of whether the CHECK OPTION is active. Possible values are:
Y
Yes, with LOCAL
C
Yes, with CASCADED
N
No
DB Name
One of the following values:
  • For a view that includes only one table space: the name of the database that contains the table space named in the TS Name column
  • For a view that includes multiple tables on multiple table spaces in a single database: the name of the database that contains all the table spaces that are part of the view
  • For a view that is created from tables in multiple databases or a view that is created from a view: a row of plus signs (++++++++).
  • For a view that is based solely on a function and not a table or view: <function-based>
TS Name
One of the following values:
  • For a view of tables that are in the same table space: the name of that table space
  • For a view of a view or a view that has multiple tables in multiple table spaces: a row of plus signs (++++++++)
  • For a view that is based solely on a function and not a table or view: <function-based>
Cols
Number of columns in the table or view.
Number of Tables
Total number of tables in the view.
APPLCOMPAT
The APPLCOMPAT level.
Current Schema
The current schema.

Displaying views by using option TV - Tables, Views, and Aliases (ADB21T) panel

Alternatively, you can see information about views on the Tables, Views, and Aliases (ADB21T) panel. However, this panel does not show whether multiple databases or table spaces are used by the view.

On the System Catalog (ADB21) panel, select option TV to display the Tables, Views, and Aliases (ADB21T) panel with a filter showing only views in the catalog, as shown in the following figure:

Figure 2. Tables, Views, and Aliases (ADB21T) panel – displaying views
 DB2 Admin ----------- DB2X Tables, Views, and Aliases ----------- ------   
                                                                                  
 Commands: GRANT       ALL                                                       
 Line commands:                                                                  
  C - Columns  A - Auth  L - List  X - Indexes  S - Table space  D - Database    
  V - Views  T - Tables  P - Plans  Y - Synonyms  SEL - Select prototyping       
  ? - Show all line commands                                                     
                                                                                 
 Sel   Name               Schema   T DB Name  TS Name    Cols        Rows Chks C 
                                                                                 
 ----- ------------------ -------- - -------- -------- ------ ----------- ---- - 
       VDEPT              DSN81010 V DSN8D10A DSN8S10D      4          -1   0  
       VHDEPT             DSN81010 V DSN8D10A DSN8S10D      5          -1   0  
       VEMP               DSN81010 V DSN8D10A DSN8S10E      5          -1   0  
       VPROJ              DSN81010 V DSN8D10A DSN8S10P      8          -1   0  
       VACT               DSN81010 V DSN8D10A DSN8S10P      3          -1   0  
       VPROJACT           DSN81010 V DSN8D10A DSN8S10P      5           1   0  
       VEMPPROJACT        DSN81010 V DSN8D10A DSN8S10P      6          -1   0  
       VCONA              DSN81010 V DSN8D10P DSN8S10C      5          -1   0  
       VOPTVAL            DSN81010 V DSN8D10P DSN8S10C     11          -1   0  
       VDSPTXT            DSN81010 V DSN8D10P DSN8S10C      3          -1   0  
       VDEPMG1            DSN81010 V DSN8D10A DSN8S10D      7          -1   0  
       VEMPDPT1           DSN81010 V DSN8D10A DSN8S10D      7          -1   0  

This panel displays data from the SYSTABLES catalog table. In the case of a view that uses multiple tables from different databases or different table spaces (for example, in a join), the DBNAME and TSNAME fields in SYSTABLES include only one of the database or table space names from one of those tables. Therefore, on the Tables, Views, and Aliases (ADB21T) panel, you cannot tell whether the DB Name or TS Name values apply to all tables that are used by the view or for only one table in a join.