Example: Defining OFF and ON Exceptions - Analytics Database - Teradata Vantage

SQL Date and Time Functions and Expressions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
cpk1628111786971.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
pxz1544241488545
lifecycle
latest
Product Category
Teradata Vantage™

In this example, an OFF and an ON exception are defined for the Teradata business calendar and the information about them is added to the DBC.BusinessCalendarException table. Days with the OFF status are non-business days. Days with the ON status are business days.

EXEC DBC.CreateException
   ('Teradata', ’OFF’, DATE '2008-03-03', 'Holiday');
EXEC DBC.CreateException
  ('Teradata', ’ON’, DATE '2008-06-07', 'Holiday make up day');

The two exceptions are inserted into the Teradata business calendar. This first exception indicates that March 3, 2008 is now a non-business day (noted in the comment as a holiday). The second exception indicates that June 7, 2008 is now a business day (noted in the comment as a day to make up for a previous holiday).

The CalendarPeriod of the Teradata calendar is from January 1, 1900 to December 31, 2100. If you try to insert holidays beyond the CalendarPeriod boundary, the insertion is aborted.