DB2 ACCESS VIEWS


Creating a DAV
1. In Domino Designer, open the Notes database that resides in DB2 for which you want to create a DAV.

2. Select Create - Design - DB2 Access View.

3. Specify the fields (columns) to use in the DAV. Choose one of these options:


4. Set the properties for each field by double-clicking on the field and completing the Access View Entry dialog box:
FieldAction
Field nameEnter the field name if adding a new field.

This is the matching field name for the DB2 column in the DAV, so it must be the actual name of a field that appears in the note (otherwise no matching field would be found and the column in the DB2 view would be blank)

Note If you used the Choose Field method of specifying the fields for the DAV, you will be able to edit the field names in the properties, but if you change the field name so that it no longer matches a field name in the note, the corresponding column in the DB2 will be blank.

Notes typeIndicate the Notes data type for this field

Note Formula, rich text, and rich text light Notes data types are not supported for use in DAVs.

DB2 typeIndicate the DB2 data type for this field. Notes will indicate a default value associated with the Notes type you choose.

Note If you have an integer defined in the DAV, and an insert from DB2 supplies a real number (with a decimal), the insert will succeed and the decimal value will be truncated.

DB2 index fieldCreates this column as a DB2 index field, which keys the database record for rapid retrieval
Allow truncation of Notes dataSpecifies that the DB2 view can "clip" the notes data (only show DB2 column length characters)
Store multiple values

Note: this option is enabled only for multi-value fields.

If a Notes field has multiple values, you can select to use:
  • first value in the field only
  • delimited values. For multi-value fields, all of the data values can appear in the view as delimited text.
DB2 multi-value delimiterIf you have chosen to use delimited values in this field, indicate the delimiter used.

This delimiter is the one that will be used to separate multiple values in the DB2 column and the delimiter that will be used to parse DB2 INSERT or UPDATES into separate values. It is not related to the delimiter specified in the form design that is used by the Notes client.

The default is a semicolon.

DB2 column length This is used to define the column length in DB2 (essentially field length in Notes).

This is only required for columns mapped to the DB2 Varchar data type (all other types are fixed length). The default for varchar is 100.


5. Click Design - DB2 Access Views to specify the properties for the DAV itself. In the DB2 Access View dialog, complete the following:
FieldAction
NameEnter a name for the DAV. This is the actual name of the DB2 view and must be a valid DB2 view name. If you enter spaces in the name, they will be converted to underscores in DB2 (e.g. zip code becomes zip_code).
CommentEnter information about the DAV
Select the form(s) associated with this DB2 Access viewSpecify the row selection criteria by doing one of the following:
  • Select all forms to associate all forms in the database with the DAV. All data notes in the NSF will have a row in the access view.
  • Select individual forms from the list box to associate with the DAV. This list is used by DB2 to determine the data with which to populate the DAV. Only data notes with a FORM item matching one of the selected values will be in the view.
6. Specify options for adding data to the DAV from DB2:
FieldAction
Compute with form on DB2 insert or updateEnable this option if the selected form(s) contain computed fields and you want the formulas to be computed when the note is created or updated using SQL.
Default form to use for DB2 inserts DB2 users can perform inserts, updates, and deletes (given the right permissions) against data in the DAV. However, you can only perform these operations against one form associated in the DAV definition, even if multiple forms are selected. Specify the form that will be used for DB2 inserts, updates, and deletes.
7. Specify DAV options on the Advanced tab:
FieldAction
Include UNID in access viewSelect to have the Notes UNID for each field appear in the DAV.
Include OID in access viewSelect to have the OID for each note appear in the DAV. If SELECTed in the Query View's SQL formula, allows document links to work when notes are selected and copied as a table.
Include modified time in access viewSelect this option to include the Notes modified time for each note in the DAV. Note that this timestamp is modified to GMT.
Normalize to GMT for time zone conversionsSelect this option to standardize all dates and times in the DB2 view to GMT. This is especially useful for distributed DB2 applications that are accessed by users in different time zones.
8. Save the view.

9. (Optional - recommended) Click Validate. Validating the DAV verifies that the definition meets the minimum requirements to build a valid DB2 view and gives you a quick way to check the validity of the Access View definition while you are still in the DAV designer.

10. Close the view.

11. In the DAV work pane, click Create/Update in DB2.

12. Click Populate in DB2. This populates the view with the field data.

Notes:


Viewing the status of your DAV

The following icons show the status of the DAV you are creating:
New DAV iconNew DAV, not yet created or populated in DB2
New DAV that has been populated iconNew DAV that has been created in DB2 (but not yet populated)
DAV has been successfully createdDAV has been successfully created and populated in DB2
Error in DAVThere is an error in the DAV

See Also