Object and Relational View

Explain the difference between object view and relational view.

Showing Answers 1 - 3 of 3 Answers

Diptiman

  • Dec 21st, 2015
 

A "Relational View" is the projection of the data using simple relational tables like:
CREATE OR REPLACE VIEW relational_view
(employee_name, department_name) AS
SELECT employee_name, department_name
FROM employee a, department b
WHERE a.department_id = b.department_id;
However an "Object - Relational View" is projection of data with collection of data as Object

Code
  1. CREATE TYPE inventory_typ

  2.  OID 82A4AF6A4CD4656DE034080020E0EE3D

  3.  AS OBJECT

  4.     ( product_id          NUMBER(6)

  5.     , warehouse           warehouse_typ

  6.     , quantity_on_hand    NUMBER(8)

  7.     ) ;

  8. /

  9.  

  10. CREATE OR REPLACE VIEW oc_inventories OF inventory_typ

  11.  WITH OBJECT OID (product_id)

  12.  AS SELECT i.product_id,

  13.            warehouse_typ(w.warehouse_id, w.warehouse_name, w.location_id),

  14.            i.quantity_on_hand

  15.     FROM inventories i, warehouses w

  16.     WHERE i.warehouse_id=w.warehouse_id;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions