Sample Header Ad - 728x90

Is it possible to alter normal column to virtual column in Oracle?

1 vote
0 answers
749 views
ALTER TABLE TAB_NAME ADD TEST_COL VARCHAR2(255);
ALTER TABLE TAB_NAME MODIFY TEST_COL GENERATED ALWAYS as ('some_exp') VIRTUAL;
Second script gives an error:
Error report -
ORA-54026: Real column cannot have an expression
54026. 0000 -  "Real column cannot have an expression"
*Cause:    Attempted to alter a real column to have an expression.
*Action:   This is not valid, change the DDL.
Asked by Raushan (113 rep)
Feb 4, 2020, 06:47 AM
Last activity: Feb 4, 2020, 08:20 AM