Working with Oracle8 Datatypes

Working with Oracle8 Datatypes - Working with Oracle8...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Working with Oracle8 Datatypes Abstract Oracle8 introduces many new datatypes that provide additional functionality in both PL/SQL programs and database table columns. Oracle8 can incorporate object-relational database concepts including the use of the new object data type. An object-relational database includes standard relational features and object-oriented constructs such as varying arrays, nested tables, and abstract datatypes. The primary advantage of incorporating object-oriented methodology in a database is to allow data modeling to more closely depict the real world than standard relational tables do. Other advantages of using object-oriented design include object reuse, standardization, and pre-defined access methods. The abstract datatypes include object tables that contain multiple columns and rows within a single object. Nested tables contain a table inside the table. Nested tables are similar to a one-to-many relationship that would be modeled using two tables in a relational design. Varying arrays are similar to nested tables but can contain only a predefined number of rows. Object Type Example The following example uses the CREATE TYPE command to create a new object datatype: SQL> CREATE TYPE address_type as OBJECT (street varchar2(120), city varchar2(30), state char(2), zip number(5)); / This example creates a new abstract data type that is an object type named address_type containing four attributes. When the CREATE TYPE command is issued, a new database object is created, in this case, a
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Working with Oracle8 Datatypes - Working with Oracle8...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online