If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > PL SQL: How to get subtype out of a supertype table?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-28-03, 17:01
OleS OleS is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Question 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
Reply With Quote
  #2 (permalink)  
Old 12-29-03, 09:07
OleS OleS is offline
Registered User
 
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


Quote:
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On