1

I've this table

parlamentari
---------------
id|nome|cognome

Can i add in this table a nested column called telefoni? I tried with

create table or replace type telefoni_nt as table of varchar2(10) after dnn;

alter table parlamentari add telefoni telefoni_nt  nested table telefoni store telefoni_tab;

without success. Thanks

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
keiichi
  • 113
  • 1
  • 1
  • 10

1 Answers1

2

I think you want :

create table parlamentari( id integer, nome varchar2(20), cognome varchar2(20));

create or replace type telefoni_nt as table of varchar2(10);

alter table parlamentari 
        add (telefoni telefoni_nt)
nested table telefoni store as telefoni_tab;

and had a typo table at "create table or replace type telefoni_nt".

SQL Fiddle Demo

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
  • Excuse me, I have a little problem. Why when I execute together all these instructions the column wasn't created and when I execute these instructions one by one, was the column been created? What is the difference? – keiichi Aug 25 '18 at 16:02
  • Ciao @keiichi, you can create the column by issueing commands altogether as seen in the fiddle. – Barbaros Özhan Aug 25 '18 at 16:47