Add column in Oracle table

user3807736 picture user3807736 · Dec 22, 2014 · Viewed 60k times · Source

I'm trying to add an XMLType column into a table, but it returns an error. Why?

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

Answer

Rob Wise picture Rob Wise · Dec 22, 2014

You don't need the "column" word in there, so it's:

ALTER TABLE test_id ADD xml_column xmltype;