Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

CHAPTER 8: Oracle Objects: An Objective ... > Using Objects to Store Data (Not Rec...

Using Objects to Store Data (Not Recommended)

As mentioned earlier, Oracle allows you to declare a table with one or more columns, the data type of which is an object type or a collection type. There are two categories of such tables:

  • Object table: An object table is a special kind of table in which each row represents an entire object. Essentially, this type of table consists of only one column, the data type of which is an object type. In the following code snippet, we create an object table of type person:
      benchmark@ORA10G> create table person_table of person;

      Table created.
  • Table with column objects: A table in which at least one column is of an object type or collection type is called (for lack of a better name) a table with column objects. A column object is an object stored as a column of a table in a row that contains at least one more attribute. For example, the table contacts defined as follows falls under this category:
      benchmark@ORA10G> create table contacts
        2  (
        3    contact_person person,
        4    contact_type varchar2(20)
        5  );

      Table created.

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint