Essentially, I've got a supertype( Person) and subtype (Student). I must place into person_objtab students object. An individual object includes a REF to deal with table so when I am attempting to add new student it provides me with 'missing expression' error. Here's the code, any assistance is highly appreciated!

create type address_objtyp as object (
    Line1 varchar2(30),
    Line2 varchar2(30),
    Line3 varchar2(30),
    Postcode varchar2(10),
    Country varchar2(20)

create type person_objtyp as object (
    NI varchar2 (20),
    Name varchar2(30),
    Address REF address_objtyp,
    Phone varchar2(30)

CREATE type student_objtyp UNDER person_objtyp (
    Dept_id varchar2(10),
    Course varchar2(10),
    StuYear number,
    Total_credits number

create table address_objtab of address_objtyp;
create table person_objtab of person_objtyp;

INSERT INTO address_objtab VALUES(
address_objtyp('9',  'Bell', 'Lancashire', ' BB52 4GF', 'the UK')

This is actually the statement which fails:

INSERT INTO Person_objtab values 
     (SELECT  2222, 'Jo', REF(aa), '0161 0450 452', '10', 'Computing', '2', 220 
       FROM address_objtab aa
      WHERE aa.postcode = ' BB52 4GF')

you are mixing in the syntax of immediate value and result set insertion and also the object constructor must be within the choose clause - try

  INTO Person_objtab (
           SELECT student_objtyp( 2222, 'Jo', REF(aa), '0161 0450 452', '10', 'Computing', '2', 220)
             FROM address_objtab aa 
            WHERE aa.postcode = ' BB52 4GF'

rather. regards, carsten

insert into person_objtab 
VALUES(student_typ(2222,'Jo',(select ref(b) 
from address_objtab b where line1 = '9 Bell'),
'01200 233 233',10,'Computing',2,220));