![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
"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 |
#12
| |||
| |||
|
|
"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 |
#13
| |||
| |||
|
|
"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 |
#14
| |||
| |||
|
|
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? |
#15
| |||
| |||
|
|
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? |
#16
| |||
| |||
|
|
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? |
#17
| |||
| |||
|
|
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? |
#18
| |||
| |||
|
|
My question was for an university exam, thanks for your hints. The book of Tom Kyte is free online? I have not found it |
#19
| |||
| |||
|
|
My question was for an university exam, thanks for your hints. The book of Tom Kyte is free online? I have not found it |
#20
| |||
| |||
|
|
My question was for an university exam, thanks for your hints. The book of Tom Kyte is free online? I have not found it |
![]() |
| Thread Tools | |
| Display Modes | |
| |