In today’s article, we will be learning how to Create a Virtual Column in Oracle Database.
Virtual column value cannot be UPDATE.
INDEX can be created on virtual columns and used in WHERE condition.
The virtual column can be created as follows;
1 2 3 4 5 6 7 8 9 10 11 | SQL> create table PERSONEL( 2 ID number(2), 3 NAME varchar2(20), 4 BDATE number, 5 YAS_DURUMU GENERATED ALWAYS AS( 6 case when BDATE between 18 and 30 then 'GENC' 7 when BDATE > 65 then 'YASLI' 8 end) 9 )tablespace DENEME; Table created. |