Programming Oracle Triggers and Stored Procedures
Authors: Owens K.
Published year: 2003
Pages: 48-49/111
Buy this book on amazon.com >>

4.4 Sample Data

STATE_LOOKUP

State

State Description

CA

California

NY

New York

NC

North Carolina

MAJOR_LOOKUP

Major

Major Description

UD

Undeclared

BI

Biology

MS

Math/Science

HI

History

EN

English

STUDENTS

Student ID

Student Name

College Major

Status

State

License No

A101

John

Biology

Degree

NULL

NULL

A102

Mary

Math/Science

Degree

NULL

NULL

A103

Kathryn

History

Degree

CA

MV-32-13

A104

Steven

Biology

Degree

NY

MV-232-14

A105

William

English

Degree

NC

MV-232-15

STUDENT_VEHICLES

State

Tag No

Vehicle Desc

Student ID

Parking Sticker

CA

CD 2348

1997 Mustang

A103

C-101-AB-1

NY

MH 8709

1998 GTI

A104

C-101-AB-2

NY

JR 9837

1982 Civic

A104

C-101-AB-3

PARKING_TICKETS

Ticket No

Amount

State

Tag No

P_01

5.00

CA

CD 2348

P_02

5.00

NY

MH 8709

P_03

5.00

NY

MH 8709

P_04

5.00

NY

JR 9837

PROFESSORS

Prof Name

Specialty

Hire Date

Salary

Tenure

Department

Blake

Mathematics

07-Jul-03

1000

YES

MATH

Milton

Am History

07-Jul-02

1000

YES

HIST

Wilson

English

08-Jul-01

1000

YES

ENGL

Jones

Euro Hist

05-Aug-00

1000

YES

HIST

Crump

Ancient Hist

04-Aug-99

1000

YES

HIST

COURSES

Course Name

Course Desc

No of Credits

ENGL101

English Lit

3

MATH101

Algebra

3

HIST102

Am History

3

BIOL103

Biology

3

STUDENTS_COURSES

Student ID

Course Name

Prof Name

A101

ENGL101

Wilson

A101

MATH101

Blake

A102

HIST102

Crump

A103

HIST102

Milton

A104

BIOL103

Blake

A104

ENGL101

Wilson


Chapter Five. Viewing Constraints in the Data Dictionary

5.1 WHAT YOU CAN SEE

5.2 DICTIONARY VIEWS: AN OVERVIEW

5.3 CONSTRAINT VIEWS

5.4 USER_CONS_COLUMNS

5.5 USER_CONSTRAINTS

5.6 DATA DICTIONARY CONSTRAINT SCRIPTS

5.6.1 Constraints on a Table

5.6.2 Chasing a Constraint Name

5.6.3 CHECK Constraint Rule

5.6.4 Querying Parent Tables

5.6.5 Querying Child Tables

5.6.6 Constraint Status

5.6.7 Validated

This chapter serves two purposes. First, we look at constraint information in the data dictionary, specifically the data dictionary views USER_CONSTRAINTS and USER_CONS_COLUMNS. An understanding of these views can be a basis for a broad understanding of how constraints are enforced by Oracle.

Second, this is a starting point for exploring the data dictionary. You will be able to extract a wide variety of information from the data dictionary: constraint information, triggers, stored procedures, sequence definitions. Anything you define in the database you can reverse-engineer with SQL.

The sample scripts in this chapter contain sample output assuming they were run against the DDL for the model in Chapter 4.

Programming Oracle Triggers and Stored Procedures
Authors: Owens K.
Published year: 2003
Pages: 48-49/111
Buy this book on amazon.com >>