Using virtual columns as defaults in a table
I have a table that I would like to assign the virtual column ora_login_user as the default (to track the Oracle ID of the person inserting a new record), much like you might use sysdate in a date-based column.
In my example, I wish to have the default of the column "ORACLE_USER" to be the virtual column ora_login_user, so the DDL is below:
ALTER TABLE MYTABLE MODIFY (ORACLE_USER DEFAULT ora_login_user ) ;
When I try this under in SQL Developer or SQLplus, it throws an ORA-00984:
"SQL Error: ORA-00984: column not allowed here