OR Experiment with Oracle

/****************************type creation*****************************************/
create or replace type phone_t force as object(
a_code CHAR(4),
p_number CHAR(8));
/

CREATE OR REPLACE TYPE arrPhone force AS VARRAY(5) OF phone_t;
/

create or replace type birth_t force as object(
year CHAR(4),
month CHAR(2),
day CHAR(2));
/

create or replace type teacher_t force as object(
name VARCHAR(30),
age VARCHAR(30));
/

create or replace type arrVChar force as varray(5) of varchar(20);
/

create or replace type dissertation_t force as object(
title VARCHAR(100),
author arrVChar,
booktitle varchar(100),
year int(4)
);
/

create or replace type student_t force as object(
name VARCHAR(30),
department VARCHAR(30),
birth birth_t,
phones arrPhone
) not final;
/

create or replace type undergraduate_t force under student_t(
r_headteacher ref teacher_t);
/

create or replace type graduate_t force under student_t(
r_dissertation ref dissertation_t);
/

 

posted on 2014-11-19 21:35  chaseblack  阅读(159)  评论(0)    收藏  举报

导航