Database Tutorial

Course Tutorial Site

Site Admin

CIT325: Lab 10 Instructions

without comments

Lab #10: Oracle Assignment

Objectives

The lab is designed to teach you how to work with Oracle’s object types, and teach you the concepts of generalization and specialization. Oracle creates object types that support collections with and without methods. Oracle object types without methods have a default constructor like tables, and they do not require the implementation of object bodies. Oracle object types with methods require you to implement object bodies, more or less, object types and bodies act like PL/SQL package specifications and bodies.

  • Learn how to create an object type with methods.
  • Learn how to implement an object body with methods.
  • Learn how to create subtypes.
  • Learn how to create overriding methods that implement generalized invocation, or polymorphism.
  • Learn how to store and use SQL to access polymorphic stored object types.

Help Section

The following is an set of sample programs and steps that address concepts in the lab. The instructor should review these in classroom or in a Google Hangout with students. Click the Instructional Material link to see the preparation lesson material.

Students may want or need supplemental articles that let them review tips and techniques. The following is a function that checks for valid dates inside strings. You should run this type of check after you rule out a number and alphanumeric string.

There are two elements to this lab. One creates the base_t object type and a logger table. The logger table creates a logger_id column for the surrogate key column and a log_text column that holds a base_t object type. The other element of the lab creates two subtypes of the base_t object type. The subtypes extend the behavior of the base_t object type.

Lab Description

  1. [10 points] Create the base_t object type, a logger table, and logger_s sequence.

    The sections cover the detailed tasks of the lab:

  1. [15 points] Create the item_t and contact_t subtypes of the base_t object type. Then, test the column substitutability in the logger table.

    The sections cover the detailed tasks of the lab:

Written by michaelmclaughlin

November 14th, 2016 at 1:42 am

Posted in