Book Image

Developing Robust Date and Time Oriented Applications in Oracle Cloud

By : Michal Kvet
Book Image

Developing Robust Date and Time Oriented Applications in Oracle Cloud

By: Michal Kvet

Overview of this book

Proper date and time management is critical for the development and reliability of Oracle Databases and cloud environments, which are among the most rapidly expanding technologies today. This knowledge can be applied to cloud technology, on premises, application development, and integration to emphasize regional settings, UTC coordination, or different time zones. This practical book focuses on code snippets and discusses the existing functionalities and limitations, along with covering data migration to the cloud by emphasizing the importance of proper date and time management. This book helps you understand the historical background and evolution of ANSI standards. You’ll get to grips with data types, constructor principles, and existing functionalities, and focus on the limitations of regional parameters and time zones, which help in expanding business to other parts of the world. You’ll also explore SQL injection threats, temporal database architecture, using Flashback Technology to reconstruct valid database images from the past, time zone management, and UTC synchronization across regions. By the end of this book, you’ll be able to create and manage temporal systems, prevent SQL injection attacks, use existing functionalities and define your own robust solutions for date management, and apply time zone and region rules.
Table of Contents (26 chapters)
1
Part 1: Discovering Oracle Cloud
4
Part 2: Understanding the Roots of Date and Time
7
Part 3: Modeling, Storing, and Managing Date and Time
12
Part 4: Modeling Validity Intervals
17
Part 5: Building Robust and Secure Temporal Solutions
20
Part 6: Expanding a Business Worldwide Using Oracle Cloud

Exploring the NEXT_DAY and NEXT_DATE functions

It often happens that you need to find the next free day in your calendar, the date of the next Wednesday, or the date of the second Sunday of the month when system updates are to be performed. In this section, we will take a closer look at two functions. The first of them is directly available within the database system. It refers to the NEXT_DAY function. However, as we will show, its evaluation and processing depend on several factors, specifically NLS parameters. Therefore, in the second part, we will propose an own function implementation that is resistant to changes in terms of the format and local parameters.

Exploring the principles of the NEXT_DAY function

The output of the NEXT_DAY function is the first weekday greater than the defined input date (date_val):

NEXT_DAY(<date_val>, <weekday>)

The following table shows the mapping principles.

Weekday

...