Overview of Object Tables

An Oracle object type is a user-defined type with a name, attributes, and methods. An object table is a special kind of table in which each row represents an object. Object types make it possible to model real-world entities such as customers and purchase orders as objects in the database.

sap erp pp production planning training courses malaysia

An object type defines a logical structure, but does not create storage. The following example creates an object type named department_typ:

CopyCREATE TYPE department_typ AS OBJECT
   ( d_name     VARCHAR2(100),
     d_address  VARCHAR2(200) );
/

The following example creates an object table named departments_obj_t of the object type department_typ, and then inserts a row into the table. The attributes (columns) of the departments_obj_t table are derived from the definition of the object type.

sap erp procurement material management training courses malaysia

CopyCREATE TABLE departments_obj_t OF department_typ;
INSERT INTO departments_obj_t 
  VALUES ('hr', '10 Main St, Sometown, CA');

Like a relational column, an object table can contain rows of just one kind of thing, namely, object instances of the same declared type as the table. By default, every row object in an object table has an associated logical object identifier (OID) that uniquely identifies it in an object table. The OID column of an object table is a hidden column.

red hat openstack training courses malaysia

See also

  • Oracle Database Object-Relational Developer’s Guide to learn about object-relational features in Oracle Database
  • Oracle Database SQL Language Reference for CREATE TYPE syntax and semantics

red hat linux certification malaysia

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *