Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003

    Red face Unanswered: Object Type Queries in Oracle9i Help!

    I need help with an sql query that displays the last name of each student along with the first and last names of their advisors. I'm sure it can be done with and without calling the method. I would like help with both approaches if possible. I have 2 tables of student_type and faculty_type and Person_type is a super_type for both without a table.

    create or replace type name_ty as object(
    first varchar2(30),
    last varchar2(30),
    mi char(1),
    member function get_fullname(
    first IN varchar2,
    last IN varchar2,
    mi IN char
    )return varchar2,
    pragma restrict_references (get_fullname, RNDS, WNDS, RNPS,RNDS)
    create type person_ty as object(
    personName name_ty,
    personAddress address_ty
    ) NOT FINAL;

    create type student_ty UNDER person_ty(
    sid number(5),
    phone varchar(10),
    class char(2),
    dob date,
    fid number(5)
    ) NOT FINAL;

    create type faculty_ty UNDER person_ty(
    fid number(5),
    dept varchar2(4),
    phone varchar2(10),
    rank varchar2(8)
    ) NOT FINAL;

  2. #2
    Join Date
    Sep 2002
    Provided Answers: 1

    Re: Object Type Queries in Oracle9i Help!

    Without any tables defined, it is impossible to write a query (and there is no data to query anyway).

  3. #3
    Join Date
    Sep 2003

    Red face Re: Object Type Queries in Oracle9i Help!

    Here are records for both the student and faculty tables of type student_type and faculty_type:

    insert into faculty values(name_ty('Lloyd', 'Yoon','M'),address_ty('96 Milly Pines','Laurel','MD','21584'),'78541','IFSM','4104 558547','ASSOC');

    insert into students values (name_ty('Micky','Johnson', 'C'),address_ty('1 Oak Lane','Baltimore','MD','21441'),'22222','410455369 8','GR','14/DEC/1977','78541');

    create table students of student_ty;

    create table faculty of faculty_ty;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts