How to check if a column is virtual in Oracle?
A virtual column is a table column whose values are calculated automatically using other column values, or another deterministic expression. In this syntax: First, specify the name ( column_name ) of the virtual column. Second, specify the virtual column's data type.
Virtual columns are columns in Oracle tables whose content is based on a formula or expression that makes use of data from other columns. They should be understood almost as one more column in the table, and can be used as part of the indexing of the table, as foreign keys in another table, include comments, etc.
In relational databases a virtual column is a table column whose value is automatically computed using other columns values, or another deterministic expression.
The values of the virtual column are not stored in the database. Rather, it's computed at run-time when you query the data. You can't update (in SET clause of update statement) the values of virtual column.
You can use the VIRTUAL_COLUMN
column of USER_TAB_COLS
(or ALL_TAB_COLS
or DBA_TAB_COLS
depending on what privileges you have and what user owns the table in question.
SELECT virtual_column
FROM all_tab_cols
WHERE owner = <<owner of the table>>
AND table_name = <<name of table>>
AND column_name = <<name of column>>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With