Skip to Content
Java Programming with Oracle SQLJ
book

Java Programming with Oracle SQLJ

by Jason Price
August 2001
Intermediate to advanced
400 pages
9h 28m
English
O'Reilly Media, Inc.
Content preview from Java Programming with Oracle SQLJ

4.2. Object Columns and Object Tables

You can use object types to define columns in a table. Such columns are known as object columns because they contain objects rather than scalar values. You can also define tables so that each row in the table represents an instance of an object. Such tables are known as object tables. In this section, you will learn to create both object columns and object tables. You will learn how to add, retrieve, and modify rows containing object columns, and how to add, retrieve, and modify rows in object tables.

4.2.1. Object Columns

An object column is a column in a table that is defined using an object type. (Objects stored in an object column are sometimes referred to as column objects.) The following example creates a table named customers. It contains one object column named customer, which is defined using the t_customer object type:

CREATE TABLE customers (
  customer t_customer
);

The customer column in this table is used to store objects of the t_customer type. You can see the structure of the table from SQL*Plus by entering the command DESC customers. For example:

SQL> DESC customers;
 Name                Null?   Type
 ------------------ -------- ----------------------------
 CUSTOMER                    T_CUSTOMER

Notice in this example that a single column of type t_customer appears as a column in the table structure.

4.2.2. Object Tables

An object table is a table in which each row contains one object of a given object type. Such objects are known as row objects. You create ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java Programming with Oracle JDBC

Java Programming with Oracle JDBC

Donald Bales

Publisher Resources

ISBN: 0596000871Catalog PageErrata