中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

9.4 Database Systems: Creation of Complex Values and Objects

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

insert into doc
values
("salesplan", set("Smith", "Jones"), (1, "April", 89), set("prot", "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 isT(); 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.

Database System Structure: