Re: simple query with types problem

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Sun, 09 Nov 2008 11:06:31 +0100
Message-ID: <4916b627$0$186$e4fe514c@news.xs4all.nl>


Shearer schreef:
> 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'));
> -----------------------------------------------------------------------------------------
>
> select indirizzo.via from persona;
>
> ORA-00904: "INDIRIZZO"."VIA": identificativo non valido
>
> ....
> Which is the correct sql command?
>
>

Try this:

select p.indirizzo.via from persona p;

Somewhere I read (can't rememeber where) that user defined types should be accessed via the alias of the table.
I tested this on Oracle XE and it works!

Shakespeare Received on Sun Nov 09 2008 - 04:06:31 CST

Original text of this message