Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 在对象关系数据库中正确填充表_Sql_Oracle10g_Object Relational Model - Fatal编程技术网

Sql 在对象关系数据库中正确填充表

Sql 在对象关系数据库中正确填充表,sql,oracle10g,object-relational-model,Sql,Oracle10g,Object Relational Model,我有一个家庭作业,要求我使用Oracle10gExpress实现一个对象关系数据库来跟踪电话计费数据。我有一个通信的超类,包含调用、文本和数据的子类。我在正确填充这些表时遇到了一个难题,这样我就可以在各个表中找到合适的数据 我的类型和表声明如下: create type CommunicationType as object ( -- column names here ) not final; create type CallType under CommunicationType (

我有一个家庭作业,要求我使用Oracle10gExpress实现一个对象关系数据库来跟踪电话计费数据。我有一个通信的超类,包含调用、文本和数据的子类。我在正确填充这些表时遇到了一个难题,这样我就可以在各个表中找到合适的数据

我的类型和表声明如下:

create type CommunicationType as object (
  -- column names here
) not final;
create type CallType under CommunicationType (
  -- column names here
);
create type TextType under CommunicationType (
  -- column names here
);
create type DataType under CommunicationType (
  -- column names here
);
create table Communications of CommunicationType (
  -- Primary and Foreign key constraints here
);
create table Calls of CallType;
create table Texts of TextType;
create table Datas of DataType;
当我尝试将数据插入其中一个子类时,它的条目不会出现在超类中。同样,如果我将
insert
插入到超类中,它不会显示在相应的子类中。例如,
insert-into-Calls-values(CallType(--values--))在通信中不显示任何数据。也不将
插入通信值(CallType(--values-)显示调用中的任何内容


我做错了什么?

您已经创建了四个单独的表。如果在一个表中插入一行,则没有理由期望在另一个表中看到您的行

基于
调用类型
文本类型
数据类型
的表从
通信类型
继承其结构和行为,但这并不意味着数据被复制。我怀疑您可能根本不需要该表
通信