Re: table with subtypes, inserting problem

From: Shearer <shearer_at_libero.it>
Date: Mon, 10 Nov 2008 16:08:21 GMT
Message-ID: <V%YRk.189724$FR.476976@twister1.libero.it>


I have asked this question because i want to create relationship between tables with REF (for object model).

Shearer wrote:

> create or replace type IndirizzoTY as object
> (via varchar(30),
> comune varchar(20),
> provincia char(2));
>
> create or replace type PersonaTY as object
> (cognome varchar(20),
> nome varchar(15),
> indirizzo indirizzoTY);
>
> create table Persona of PersonaTY;
>
> insert into Persona values('Insegno','Pino',IndirizzoTY('Via
> Dante','Roma','Rm'));
>
> create type TelefonoTY as object
> (abitazione varchar(12),
> ufficio varchar(12),
> cellulare varchar(12));
>
> alter type PersonaTY add attribute (telefono REF TelefonoTY) cascade;
>
> create table Telefono of TelefonoTY;
>
> insert into Telefono values('099342312','099102121','3498282821');
> ------------------------------------------------------------------------------------------
>
> insert into Persona
> select 'Smith','John'.................................
>
>
> How to insert values into the column "indirizzo" of Persona?
Received on Mon Nov 10 2008 - 10:08:21 CST

Original text of this message