SQL 在 Oracle 表中添加列
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27597378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Add column in Oracle table
提问by Rob Wise
I'm trying to add an XMLType column into a table, but it returns an error. Why?
我正在尝试将 XMLType 列添加到表中,但它返回错误。为什么?
This is the query:
这是查询:
alter table TEST_ID add column xml_column xmltype;
It returns the error:
它返回错误:
[SQL] alter table TEST_ID add column xml_column xmltype
[Err] ORA-00904: : invalid identifier
回答by Rob Wise
You don't need the "column" word in there, so it's:
你不需要那里的“列”词,所以它是:
ALTER TABLE test_id
ADD xml_column xmltype;
ALTER TABLE test_id
ADD xml_column xmltype;
回答by elfekz
In addition,
此外,
you can add multiple columns at the same time with:
您可以同时添加多个列:
ALTER TABLE table_name ADD (column1 VARCHAR(40), column2 Date, column3 Number);