next up previous
Next: Comparison of Object-Oriented and Up: Object-Relational Databases Previous: Functions

Creation of Complex Values and Objects

  1. Create and updates tuples with complex types (tuple-valued and set-valued)

    		 insert into doc


    (``salesplan'', set(``Smith'', ``Jones''), (1, ``April'', 89), set(``profit'', ``strategy'')

  2. We can also use complex values in queries: anywhere in a query where a set is expected, we can enumerate a set.

    		 select name, date

    from doc

    where name in set (``salesplan'', ``opportunities'', ``risks'')

  3. To create new objects, we can use constructor functions. The constructor function for an object type T is T(); when it is invoked it creates a new uninitialized object of type T, fills in its oid field, and returns the object. The fields of the object must then be initialized.

Osmar Zaiane
Tue Jul 7 15:03:55 PDT 1998