G-3160: Avoid visible virtual columns.
Major
Maintainability, Reliability
Unsupported in db* CODECOP Validators
We cannot identify the type of a column. Requires create table
and alter table
parser support or access to the Oracle Data Dictionary.
Restriction
Oracle Database 12c
Reason
In contrast to visible columns, invisible columns are not part of a record defined using %rowtype
construct. This is helpful as a virtual column may not be programmatically populated. If your virtual column is visible you have to manually define the record types used in API packages to be able to exclude them from being part of the record definition.
Invisible columns may be accessed by explicitly adding them to the column list in a select
statement.
Example (bad)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
1 2 3 |
|
Example (good)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|