HP 3000 Manuals

View owned by SYSTEM and CATALOG (Cont.) [ ALLBASE/SQL Database Administration Guide ] MPE/iX 5.5 Documentation


ALLBASE/SQL Database Administration Guide

View owned by SYSTEM and CATALOG (Cont.) 

Locking of the System Catalog (Cont.) 

System.ViewDef.   

The SYSTEM.VIEWDEF view displays information about view definitions,
including the SELECT part of each CREATE VIEW statement used to create a
view.  The SELECT is stored in a series of segments of up to 64 bytes.

SYSTEM.VIEWDEF is initially empty, and it is updated whenever ALLBASE/SQL
processes a CREATE VIEW statement, a DROP VIEW statement, or a TRANSFER
OWNERSHIP statement on a view.  System views are not included in
SYSTEM.VIEWDEF.

When the view is dropped, the rows making up the byte string of the
SELECT portion are deleted.  If a TRANSFER OWNERSHIP is done on the view,
the owner field in this table is updated with the name of the new owner.

          Table 8-42.  System.ViewDef 

-------------------------------------------------------------------------------------------------
|                       |              |          |                                             |
|      Column Name      |     Type     |  Length  |                 Description                 |
|                       |              |          |                                             |
-------------------------------------------------------------------------------------------------
|                       |              |          |                                             |
|       VIEWNAME        |     CHAR     |    20    | Name of the view                            |
|                       |              |          |                                             |
-------------------------------------------------------------------------------------------------
|                       |              |          |                                             |
|         OWNER         |     CHAR     |    20    | Owner of the view                           |
|                       |              |          |                                             |
-------------------------------------------------------------------------------------------------
|                       |              |          |                                             |
|       QUALIFIER       |     CHAR     |    20    | Owner name to be used to qualify any        |
|                       |              |          | unqualified objects referenced in the       |
|                       |              |          | SELECT byte string                          |
|                       |              |          |                                             |
-------------------------------------------------------------------------------------------------
|                       |              |          |                                             |
|        SEGNUM         |   INTEGER    |    4     | Segment Number                              |
|                       |              |          |                                             |
-------------------------------------------------------------------------------------------------
|                       |              |          |                                             |
|        SEGLEN         |   INTEGER    |    4     | Length of segment in bytes (up to 64)       |
|                       |              |          |                                             |
-------------------------------------------------------------------------------------------------
|                       |              |          |                                             |
|     SELECTSTRING      |     CHAR     |    64    | SELECT byte string segment                  |
|                       |              |          |                                             |
-------------------------------------------------------------------------------------------------

Example.   

     SELECT * FROM System.ViewDef WHERE VIEWNAME = 'VENDORSTATISTICS';
     --------------------+--------------------+--------------------+------
     VIEWNAME            |OWNER               |QUALIFIER           |SEGNUM
     --------------------+--------------------+--------------------+------
     VENDORSTATISTICS    |PURCHDB             |PURCHDB             |     1
     VENDORSTATISTICS    |PURCHDB             |PURCHDB             |     2
     VENDORSTATISTICS    |PURCHDB             |PURCHDB             |     3
     VENDORSTATISTICS    |PURCHDB             |PURCHDB             |     4
     VENDORSTATISTICS    |PURCHDB             |PURCHDB             |     5
     ---------------------------------------------------------------------------
     First 5 rows have been selected.
     U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>,or e[nd]> r

     +------+---------------------------------------------------------------
     |SEGLEN|SELECTSTRING
     +------+---------------------------------------------------------------
     |    64| SELECT PurchDB.Vendors.VendorNumber,PurchDB.Vendors.VendorName
     |    51|, OrderDate,OrderQty,OrderQty*PurchasePrice FROM
     |    58|PurchDB.Vendors,PurchDB.Orders,PurchDB.OrderItems WHERE
     |    63|PurchDB.Vendors.VendorNumber=PurchDB.Orders.VendorNumber AND
     |    60|PurchDB.Orders.OrderNumber=PurchDB.OrderItems.OrderNumber;
     ---------------------------------------------------------------------------
     First 5 rows have been selected.
     U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>,or e[nd]> r



MPE/iX 5.5 Documentation