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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 03:05:17  来源:igfitidea点击:

Add column in Oracle table

sqloraclexmltype

提问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);