0

スーパータイプのカスタマーサービスとサブタイプのエージェントとスーパーバイザーを作成しようとしていますが、値を固有にすることができますが、Oracle SQLでこれを実行しようとすると、メッセージが表示されます

Warning: Type created with compilation errors.

以下のコードの何が問題になっていますか?

Create or replace type customer_s_type as object (
   csID number, 
   csName varchar(15),
   csType number ) NOT FINAL;

Create or replace type supervisor_type UNDER customer_s_type ( title varchar (10) );  

Create or replace type agent_type UNDER customer_s_type (title varchar (10)); 

Create table supervisor of supervisor_type (
   CONSTRAINT supervisor_PK PRIMARY KEY (csID));

Create table agent of agent_type (CONSTRAINT agent_PK PRIMARY KEY (csID));

create table customer_service(
   csID number(10),
   csType number(10),
   constraint supervisor_pk primary key(csID) );
4

1 に答える 1

3

show errorsSQL*Plus または SQL Developer で、またはを使用select * from user_errorsして、エラーの詳細を表示できます。

6 つのコマンドを表示し、警告は最初の 3 つのうちの 1 つに関するものであり (それは を参照しているためtype)、コメントで指摘された制約とは別に、それらは独立して問題ないように見えるため、スクリプト全体が 1 つのコマンドとして解釈されているように見えます。 . クライアントの設定によって異なりますが、コマンドを実行するには、コマンドを a で区切るだけでよいでしょう/。型には PL/SQL を含めることができる;ため、ステートメント区切りとして扱われません。そう:

Create or replace type customer_s_type as object (
   csID number, 
   csName varchar(15),
   csType number ) NOT FINAL;
/

Create or replace type supervisor_type UNDER customer_s_type ( title varchar (10) );
/

Create or replace type agent_type UNDER customer_s_type (title varchar (10));
/

Create table supervisor of supervisor_type (
   CONSTRAINT supervisor_PK PRIMARY KEY (csID));

Create table agent of agent_type (CONSTRAINT agent_PK PRIMARY KEY (csID));

create table customer_service(
   csID number(10),
   csType number(10),
   constraint customer_service_pk primary key(csID) );
于 2013-06-20T21:26:56.677 に答える