DB2 ACCESS VIEWS


DB2 Access views
IBMR LotusR Domino(TM) Designer includes two types of design elements to assist you in managing data contained in DB2 enabled IBMR LotusR NotesR databases:
For more information on query views, see DB2 query views.

A Notes database typically includes many different types of notes. When you enable a Domino server for DB2, Domino stores its Notes data in DB2. A DB2 database consists of multiple tables that are composed of columns and rows. Data in DB2 databases is accessed and manipulated through Structured Query Language (SQL) statements.

When a Notes database is enabled for DB2, Domino creates a DB2 database schema for it, as well as a set of tables in that schema to hold the Notes database data. The schema name is based on the NSF file name. Any DAVs you create will also be located in this schema.

Including all of the notes in an NSF in a single DB2 table would not be effective for SQL access, because a set of notes does not typically have a uniform set of fields (or columns, in a DB2 database) and therefore would probably not be able to be grouped in ways that make sense for SQL queries. To make SQL access useful and manageable, you must define DB2 views that specify the columns you want to access via SQL, and the notes that belong in this view (which constitute the rows of the view).

You define and manage these DB2 views of your data using a design element called the DB2 Access view (DAV). The DAV is a shared resource that enables Notes designers to create views of data in DB2 enabled Notes databases. While the DAV actually exists in DB2, it is accessible by both Domino and non-Domino applications.

You do the following to define a DAV:


For example, suppose you have an NSF that contains mailing list information for several different groups, and you want to consolidate information for three of those mailing lists: PTA, Book group, and Playground fund raiser. These mailing lists (forms) all contain the same basic information -- name, address, city, zip -- as well as some other information specific to each activity.

When you create a DAV for this NSF data, you select the four address fields from the 'PTA' form to define the columns in DB2. (As these fields are the same on all forms, it does not matter which form you use to create the column definitions.)

Next, you select which notes you want to appear in the DB2 view by selecting all three of these forms.

After the DAV is successfully created, you will be able to query the consolidated mailing list in DB2. This DB2 view would contain the four specified columns for all the notes created with the selected forms. Other fields on the selected notes would not be visible in DB2 because they are not part of the view column specification. For example, phone numbers would not be visible in DB2 because the phone number field was not selected as a column definition. Furthermore, notes created with other forms would not appear in the view because they are not part of the views row selection criteria. For example, notes created from the mailing list form 'Holiday cards' would not appear in the DAV.

Once the DAV is created, any subsequent changes made to the Notes data will immediately be visible in DB2. Any changes to the notes made using SQL will immediately be visible in Notes (you may need to refresh the Notes view to see change in the Notes client).

Note The size of a DAV and its entities (tables, views, triggers, and indexes) are not included in the total file size of the DB2 enabled Notes database for which it was created. Therefore, if you have numerous DAVs associated with a DB2 enabled Notes database, be aware that they occupy disk space above and beyond that of the DB2 enabled Notes database.

Prerequisites for working with Notes databases that reside in DB2

In order to work with DB2 enabled databases, your Domino administrator should have set up your environment as follows:


See Also