5 Implementing Data Integrity Rules

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.1 What is a data integrity rule?

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.2 Why data integrity rules should always be implemented in the database

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.3 Specifying business rules

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.4 Categories of business rules

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5 Implicit Data Integrity Rules of table definitions

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1 Data type, length, precision, scale and semantics

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1.1 NUMBER (and its subtypes)

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1.2 DATE, TIMESTAMP and TIMESTAMP WITH TIME ZONE

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1.3 VARCHAR2, CHAR, NVARCHAR2, NCHAR

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1.4 Spatial types

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1.5 RAW and LONG RAW

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1.6 CLOB, BLOB and BFILE

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1.7 XMLTYPE and JSONTYPE

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1.8 BOOLEAN

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.1.9 User-defined data types

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.2 Collation

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.3 Optionality

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.4 Auto-increment property

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.5.5 Default Value

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6 Implementing Data Integrity using constraints

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.1 VALIDATE/NOVALIDATE

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.2 DEFERRABLE constraints

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.3 Collation

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.4 The purpose of check constraints

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.5 Advantages of check constraints over other implementations of attribute and tuple rules

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.6 Disadvantages of check constraints

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.7 Examples of check constraints

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.7.1 Constraint example 1 Testing dates

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.7.2 Constraint example 2 The exclusive arc relation

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.7.3 Constraint example 3 Testing on limit values

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.7.4 Constraint example 4 Validating JSON

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.7.5 Constraint example 5 Checking domain values

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.7.6 Constraint example 6 Conditional optionality

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.6.8 Summary of using database constraints

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.7 Implementing Data Integrity Rules using database triggers

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.7.1 Examples of implementing data integrity rules in database triggers

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.7.1.1 Trigger example 1 Conditional optionality

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.7.1.2 Trigger example 2 Restricted foreign keys

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.7.1.3 Trigger example 3 Conditional updatability

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.7.1.4 Trigger example 4 Domain checks against a table

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.7.1.5 Trigger example 5 Preventing overlapping value ranges and gaps between ranges

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.7.2 Summary using database triggers

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.8 Implementing business rules and functionality using APIs

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.

5.8.1 An API for creating an Order

This content is not available in the sample book. The book can be purchased on Leanpub at http://leanpub.com/the-oracle-database-in-modern-it-architectures.