dbTalk Databases Forums  

table with subtypes, inserting problem

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss table with subtypes, inserting problem in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Shearer
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 12:22 PM






My question was for an university exam, thanks for your hints. The book of
Tom Kyte is free online? I have not found it


gym dot scuba dot kennedy at gmail wrote:

Quote:
"Shearer" <shearer (AT) libero (DOT) it> wrote in message
news:V%YRk.189724$FR.476976 (AT) twister1 (DOT) 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?


I know you can do this in Oracle. However you may choose to have an
object
view and store the data in traditional manner. I use objects and
collections quite frequently in pl/sql. I do not use them in storing
things
to the db. If you read Tom Kyte's first book it goes into all the little
bits andpieces that occur in storing objects. At least at the time it
raised some performance issues and the management of those issues more
complex.

My recommendation - if this is going to be a production system - is use
standard "old" relations and have pl/sql wrappers for the programming
language that is going to interact with the DB. (eg Java etc.) If this is
just an experiment to increase your learning then go for it.
Jim


Reply With Quote
  #12  
Old   
Shearer
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 12:22 PM






My question was for an university exam, thanks for your hints. The book of
Tom Kyte is free online? I have not found it


gym dot scuba dot kennedy at gmail wrote:

Quote:
"Shearer" <shearer (AT) libero (DOT) it> wrote in message
news:V%YRk.189724$FR.476976 (AT) twister1 (DOT) 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?


I know you can do this in Oracle. However you may choose to have an
object
view and store the data in traditional manner. I use objects and
collections quite frequently in pl/sql. I do not use them in storing
things
to the db. If you read Tom Kyte's first book it goes into all the little
bits andpieces that occur in storing objects. At least at the time it
raised some performance issues and the management of those issues more
complex.

My recommendation - if this is going to be a production system - is use
standard "old" relations and have pl/sql wrappers for the programming
language that is going to interact with the DB. (eg Java etc.) If this is
just an experiment to increase your learning then go for it.
Jim


Reply With Quote
  #13  
Old   
Shearer
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 12:22 PM



My question was for an university exam, thanks for your hints. The book of
Tom Kyte is free online? I have not found it


gym dot scuba dot kennedy at gmail wrote:

Quote:
"Shearer" <shearer (AT) libero (DOT) it> wrote in message
news:V%YRk.189724$FR.476976 (AT) twister1 (DOT) 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?


I know you can do this in Oracle. However you may choose to have an
object
view and store the data in traditional manner. I use objects and
collections quite frequently in pl/sql. I do not use them in storing
things
to the db. If you read Tom Kyte's first book it goes into all the little
bits andpieces that occur in storing objects. At least at the time it
raised some performance issues and the management of those issues more
complex.

My recommendation - if this is going to be a production system - is use
standard "old" relations and have pl/sql wrappers for the programming
language that is going to interact with the DB. (eg Java etc.) If this is
just an experiment to increase your learning then go for it.
Jim


Reply With Quote
  #14  
Old   
Shakespeare
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 01:56 PM



Shearer schreef:
Quote:
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?


Didn't you just do that in your own insert statement?

Shakespeare


Reply With Quote
  #15  
Old   
Shakespeare
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 01:56 PM



Shearer schreef:
Quote:
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?


Didn't you just do that in your own insert statement?

Shakespeare


Reply With Quote
  #16  
Old   
Shakespeare
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 01:56 PM



Shearer schreef:
Quote:
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?


Didn't you just do that in your own insert statement?

Shakespeare


Reply With Quote
  #17  
Old   
Shakespeare
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 01:56 PM



Shearer schreef:
Quote:
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?


Didn't you just do that in your own insert statement?

Shakespeare


Reply With Quote
  #18  
Old   
joel garry
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 07:02 PM



On Nov 10, 9:22*am, Shearer <shea... (AT) libero (DOT) it> wrote:
Quote:
My question was for an university exam, thanks for your hints. The book of
Tom Kyte is free online? I have not found it
Please don't top-post. Tom's books are not free, but well worth the
expense. Some parts of them are online, and check out http://asktom.oracle..com.

jg
--
@home.com is bogus.
http://www.techdirt.com/articles/200...18162765.shtml


Reply With Quote
  #19  
Old   
joel garry
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 07:02 PM



On Nov 10, 9:22*am, Shearer <shea... (AT) libero (DOT) it> wrote:
Quote:
My question was for an university exam, thanks for your hints. The book of
Tom Kyte is free online? I have not found it
Please don't top-post. Tom's books are not free, but well worth the
expense. Some parts of them are online, and check out http://asktom.oracle..com.

jg
--
@home.com is bogus.
http://www.techdirt.com/articles/200...18162765.shtml


Reply With Quote
  #20  
Old   
joel garry
 
Posts: n/a

Default Re: table with subtypes, inserting problem - 11-10-2008 , 07:02 PM



On Nov 10, 9:22*am, Shearer <shea... (AT) libero (DOT) it> wrote:
Quote:
My question was for an university exam, thanks for your hints. The book of
Tom Kyte is free online? I have not found it
Please don't top-post. Tom's books are not free, but well worth the
expense. Some parts of them are online, and check out http://asktom.oracle..com.

jg
--
@home.com is bogus.
http://www.techdirt.com/articles/200...18162765.shtml


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.