Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2012

    Unanswered: Object Relationship help

    Hi guys,
    currently i am working on a project that requires the use of objects with subtypes, nested tables and procedures to update information.
    Basically, i have table which will store information about toys. Within this there will be the following fields:
    and then some more specific information. The specific information for each toy is:
    The toy_type can be electronic, game, or wooden.
    For electronic I need to store Battery_Type and Number_of_Batteries.
    For type Game, I need to store, Type, this could card_game, board_game or other_game.
    For type wooden, I need to store Painted(Y/N).

    Now this was my first attempt at the solution but I cant seem to link the specific toy information into the same table. Will i have to create three separate tables then link them together?:

    DROP TYPE electronic_toy;
    DROP TYPE wooden_toy;
    DROP TYPE board_toy;
    DROP TYPE toy_typ;

    create type toy_typ AS OBJECT
    ( toy_id number(5),
    toy_name VARCHAR2(20),
    toy_cost NUMBER(4),
    age_range VARCHAR2(12),
    rdy_allocation char(1),
    spec varchar2(50),
    member procedure update_allocation) NOT FINAL;
    CREATE TABLE toy_objtab of toy_typ;
    CREATE TYPE electronic_toy UNDER toy_typ
    ( toy_type varchar2(20),
    batt_type varchar2(5),
    toy_number NUMBER (1));
    CREATE TYPE wooden_toy UNDER toy_typ
    ( toy_type varchar2(20),
    painted char(1));
    CREATE TYPE board_toy UNDER toy_typ
    ( toy_type varchar2(20),
    game_type varchar2(20));

    any help would be greatly appreciated. Thanks in advance for your time and efforts

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    >currently i am working on a project that requires the use of objects with subtypes, nested tables
    Object Oriented design & any RDBMS mix as well as oil & water.
    They are orthogonal concepts.
    It is almost a 100% certainty that the resultant application will NOT scale.
    If you proceed as planned, You're On Your Own (YOYO)!
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Tags for this Thread

Posting Permissions

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