Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add column in Oracle table

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

2 Answers

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

ALTER TABLE test_id ADD xml_column xmltype;

like image 183
Rob Wise Avatar answered Sep 02 '25 21:09

Rob Wise


In addition,

you can add multiple columns at the same time with:

ALTER TABLE table_name ADD (column1 VARCHAR(40), column2 Date, column3 Number);
like image 28
elifekiz Avatar answered Sep 02 '25 19:09

elifekiz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!