DB2V10-Temporal data System Time & Business Time

In any big business like Insurance,Finance and Banking, the need of data happened in particular time period is required.

The business time indicates the period during which the data is accurate with respect to the world. The system time indicates the period during which the data is stored in the database.

Business Time:Business time is applicable to only certain types of data that change over time, and the validity of the data is relevant to the application and users.

System Time:System time, also referred to as transaction time, denotes the time when the fact became current in the database. System time can be used to track the insertion and modification history of the data.

Check an example Query:

CREATE TABLE COURSE
  (COURSENO   INTEGER      NOT NULL,
   TITLE      VARCHAR(20)  NOT NULL,
   CREDITS    SMALLINT     NOT NULL WITH DEFAULT 3,
   PRICE      DECIMAL(7,2) NOT NULL,
   BUS_START  DATE         NOT NULL,
   BUS_END    DATE         NOT NULL,

PERIOD BUSINESS_TIME(BUS_START, BUS_END),

PRIMARY KEY(COURSENO, BUSINESS_TIME WITHOUT OVERLAPS)
);

Period Business_time, denotes time period.

Business_time without overlaps , it checks time overlap

The functions are:

  • FOR BUSINESS_TIME AS OF
  • FOR BUSINESS_TIME FROM

  • FOR BUSINESS_TIME BETWEEN

In my next post I will give more details on how to use these functions.

About these ads

Have Something to Say? Post Your Comment

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s