Introduction to DB2/DB2 Concents and Facilities

The DB2 Environment

The DB2 environment is made up of these DB2 objects:

At the time of object creation, the DB2 catalog is updated with the name and characteristics of each object.

Only the creation of tablespaces and indexes has any effect on your physical MVS environment. The creation of tablespaces and indexes physically allocates the primary space quantity requested for the tablespace or index (unless you have already created your own VSAM data sets). This is the space that will be used when data is loaded into the tablespace and the indexes are built.

Column Attributes

As part of a table definition, columns are named and each named column is assigned a data quality known as an attribute.

In addition to the attribute assigned to each column, there must also be an attribute qualifier assigned to each column.

The purpose of the attribute qualifier is to signal to DB2:

Numeric Data Types

Columns needing a numeric data quality can be assigned one of the following:

Character Data Types

Columns needing a character data quality can be assigned one of the following:

Using the CHAR/VARCHAR data types for columns will make it possible for those columns to be searched usina the wild card functions built into SQL.

Graphic Data Types

Graphic data types are needed for certain foreign languages whose character sets exceed 256 characters and symbols. Graphic data types use the Double-Byte Character Set (DBCS).

The characteristics of graphic data types are the same as character data types except that graphic data requires two bytes of storage for each character or symbol.

Date/Time Data Types

Columns may be assigned one of the following date/time data types:

When data is stored within a column with one of these data types, the internal representation is defined by DB2 and is transparent to the user. Data retrieved from a column of this type will be placed into a character string format. Various external formats are available for both date and time.

External formats for columns containing date or time can be specified for the entire site when DB2 is installed, or can be set through the date or time precompiler options.

To insert or update data values in a column of this type, you can make use of the following DB2 special registers:

CURRENT TIMEZONE is the difference between CURRENT TIME and Greenwich Mean Time (hhmmss).

View Object

A VIEW is defined to be an alternative representation of data from one or more tables. There is no data physically stored in a view. It is a logical definition of the columns and/or rows that will be presented to an authorized user. It can also be used to restrict the privileges of INSERT, UPDATE, and DELETE to specific columns and/or rows.

Views make it possible to tailor the way data is presented to an application or end user.

Views provide a means of achieving row and colunm sensitive security and true data independence.

Structured Query Language (SQL)

DB2, like other relational databases, requires the use of the Structured Query Lanauaae (SQL) to define and manipulate data.

SQL is the language used to manipulate:

SQL has three major components:


OIT Applications Support


Last Modified:

©2001 All Rights Reserved