Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Question Unanswered: PL SQL: How to get subtype out of a supertype table?

    Hi all.

    I have a supertype 'player_t' and a subtype 'misterx_t'. I have also a table of the supertype with three supertype entities and on subtype entity in it(no table for the subtype). I have inserted them with the regular insert-statement:

    insert into player_tab
    values
    (player_t(‘detektiv3’, 10,10,10));

    insert into player_tab
    values
    (misterx_t(‘misterx’,10,10,10,5,3));

    All entities were inserted correctly and if a run a select value(...) ... -command, oracle shows that misterx is of misterx_t and has all attributes (two more than a player)!
    But now the problem:
    How can I get the subtype out of the supertype table? I only get the supertype part of the subtype entity, but I need the whole entity (with the two more attributes)!
    Is there any way to read the whole value?

    Thanks for helping!
    Greets,
    Sven

  2. #2
    Join Date
    Dec 2003
    Posts
    2

    Thumbs up got it myself

    got it myself, thanks.

    select TREAT (value(p) as misterx_t) from player_tab p where rolle like 'misterx';

    Greets,
    Sven


    Originally posted by OleS
    Hi all.

    I have a supertype 'player_t' and a subtype 'misterx_t'. I have also a table of the supertype with three supertype entities and on subtype entity in it(no table for the subtype). I have inserted them with the regular insert-statement:

    insert into player_tab
    values
    (player_t(‘detektiv3’, 10,10,10));

    insert into player_tab
    values
    (misterx_t(‘misterx’,10,10,10,5,3));

    All entities were inserted correctly and if a run a select value(...) ... -command, oracle shows that misterx is of misterx_t and has all attributes (two more than a player)!
    But now the problem:
    How can I get the subtype out of the supertype table? I only get the supertype part of the subtype entity, but I need the whole entity (with the two more attributes)!
    Is there any way to read the whole value?

    Thanks for helping!
    Greets,
    Sven

Posting Permissions

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