将列添加到嵌套表

时间:2018-08-25 01:11:00

标签: oracle oracle11g nested-table

我有这张桌子

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

我可以在此表中添加一个称为Telefoni的嵌套列吗? 我尝试过

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;

没有成功。 谢谢

1 个答案:

答案 0 :(得分:2)

我想你想要

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;

并在“ 创建或替换类型telefoni_nt ”处出现错字

SQL Fiddle Demo

相关问题