Database Administration (MOSC)

MOSC Banner

Using virtual columns as defaults in a table

edited Oct 28, 2010 4:03AM in Database Administration (MOSC) 10 commentsAnswered
Hi,

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

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center