Click here to Skip to main content
15,880,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 3 tables , i know that it is an interference condition


table person(P_ID,Name,Age)
table owner (O_ID,Insuranceinfo)
table driver(D_ID,Licensenumber)


I created the parent table Person:

create table person(
P_id Integer Primary Key,
name char(30),
age integer
)


What I have tried:

create table owner(
o_id Integer Primary Key,
Insuranceinfo char(30)
)
INHERITS(person)
Posted
Updated 4-Mar-20 8:35am

1 solution

In Oracle you would use a type definition. Have a look at CREATE TYPE[^], including UNDER definition.

After creating the type you would use it in CREATE TABLE[^] in order to create an object table.
 
Share this answer
 
Comments
Abed Al Rahman Hussien Balhawan 4-Mar-20 14:55pm    
something like that ?
CREATE OR REPLACE TYPE PERSON AS OBJECT (
P_ID integer,
Name Char(20),
Age Integer
);
Wendelius 4-Mar-20 22:59pm    
For the type definition yes, but I understood that you wanted a table so next step would be creating an object table of that type.

Have a look at the examples in CREATE TABLE documentation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900