Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert ref data into nested table

Status
Not open for further replies.

singjiu

MIS
Apr 4, 2003
1
MY
I have listed some of the important codes.

create type subject_type as object
(subject_id char(7), subject_name varchar(50), semester integer, location
varchar(20), day_taught date, sub_school ref school_type);

create type sub_ref_type as object
(subj ref subject_type, semester date);

create type subject_list_type as table of sub_ref_type;

create type lecturer_type under person_type
(lecturer_id char(6), start_date timestamp(3), qualification varchar(50),
school_belong ref school_type, teaching_subject subject_list_type, member
function getTeachingY return interval year to month);

create table lecturer_objtab of lecturer_type
(lecturer_id constraint lecturer_id_pk_t primary key, school_belong scope is
school_objtab) nested table teaching_subject store as teaching_subject_list;

insert into lecturer_objtab (lecturer_id, name, address, dob, gender,
start_date, qualification, contact_num, school_belong, teaching_subject) values
('L02356', 'Chong Ee Vern', address_type('93, Kampung Salang',
'Kubang Pasu', '06150', 'Kedah'), to_date('05-12-1975',
'dd-mm-yyyy'), 'F', to_date('05-1998','mm-yyyy'),
'Master of Business Adminstration', contact_list_type('04-7940212'),
(select ref(s) from school_objtab s where school_id = 'BUS'),
subject_list_type()
);

insert into table (select l.teaching_subject from lecturer_objtab l where l.lecturer_id =
'L02356')
select ref(sub), to_date('1-2001', 'mm-yyyy') from subject_objtab sub
where sub.subject_id = 'CF1011' ;


When I insert the final statement, an error message occurs:-
"cannot INSERT object view REF or user-defined REF"

Please help me, thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top