16 Create an Object Relational Database
How do I…
16.1 Create object types and use them in relational tables?
16.2 Use constructor methods to populate object relational tables?
16.3 Create and use object tables?
16.4 Create and use the VARRAY collection type?
16.5 Create and use the nested table collection type?
16.6 Create and use object views?
16.7 Issue DML commands on object views and use INSTEAD OF triggers?
16.8 Use MAP and ORDER methods to compare objects?
Oracle Corporation has chosen not to abandon its relational database roots with the release of Oracle8. Accordingly, this new version of the database is not purely object-oriented. It still supports all the relational technology that has become an integral part of many organizations’ database environments. Object extensions, however, comprise one of the most exciting enhancements to the Oracle database under Oracle8. An object relational database is a fusion of relational and object-oriented technologies and enables users to gradually integrate object technology with existing relational applications. Developers can use objects in relational tables, create pure object tables, and define object views to allow object-oriented navigation of existing relational structures under the Oracle8 umbrella.
16.1 Create Object Types and Use Them in Relational Tables
The easiest way for relational database users to become familiar with object-oriented database technology is to draw parallels between database objects and standard relational database tables. In some ways, these entities are not that different. This How-To explains creation of object types and their inclusion in relational table definitions.
16.2 Use Constructor Methods to Populate Object Relational Tables
The SQL syntax for populating tables containing object columns is also new in Oracle8. This How-To introduces the concept of a method and shows how to use a particular type of method, called a constructor method, to insert data into object-enabled relational tables.
16.3 Create and Use Object Tables
How-To 16.1 showed how to integrate object types and relational table definitions. Object tables, the subject of this section, are one step closer to pure object-oriented constructions. This How-To defines object tables and discusses how to use them to enforce the foreign key relationships common to relational database designs.
16.4 Create and Use the VARRAY Collection Type
Collection types have played a major role in object-oriented languages for some time and Oracle8 offers an ordered collection type through the VARRAY datatype. Definition and use of VARRAYs are the subjects of this How-To.
16.5 Create and Use the Nested Table Collection Type
Nested tables are another collection type supported in Oracle8. Like VARRAYs, they can help model one-to-many relationships without the overhead associated with traditional joins. This How-To focuses on the definition and use of nested tables.
16.6 Create and Use Object Views
Object views provide a way to impose an object structure over a relational database design without disturbing legacy applications. They provide a low-risk migration path to object-oriented architectures. This How-To describes creating an object view of some familiar sample database tables.