I have added a new column to a table using:
ALTER table table_name add column_name number(8);
And then updated it as below:
UPDATE table_name set column_name = column_name.nextval;
And then I tried to modify column to a not NULL column as below:
ALTER table table_name modify (column_name DEFAULT on null column_name.nextval)
after the last query I got the below error:
ORA-00936 : missing expression
NOTE - the new column added here is a Sequence.
Could you please let me know what am I missing here.
Thank you.
alte table
you have to specify what to do with the column. The syntax is:{ add_column_clause | modify_column_clauses | drop_column_clause | add_period_clause | drop_period_clause }... | rename_column_clause