Home » SQL & PL/SQL » SQL & PL/SQL » table with subtypes, inserting problem (Oracle 10g on windows xp)
table with subtypes, inserting problem [message #358300] Mon, 10 November 2008 11:02 Go to next message
Messages: 1
Registered: November 2008
Location: Taranto, Italy
Junior Member
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

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?
I have asked this question because i want to create relationship between tables with REF (for object model).
Re: table with subtypes, inserting problem [message #358376 is a reply to message #358300] Tue, 11 November 2008 01:10 Go to previous message
Messages: 515
Registered: February 2008
Senior Member
for example:
insert into persona(telefono) SELECT REF(e) FROM Telefono e WHERE e.cellulare = '3498282821';
Previous Topic: Need help
Next Topic: Query output - Help
Goto Forum:

Current Time: Fri Jul 21 03:57:26 CDT 2017

Total time taken to generate the page: 0.11758 seconds