Actions that can be performed on virtual columns:
1. A virtual column can be used in WHERE clause of a SELECT, UPDATE or DELETE statement.
2. Statistics can be collected on them.
3. They can be used as a partition key to partition a table.
4. Indexes can be created on these columns.
5. Constraints can be created on them.
Actions that cannot be performed on virtual columns:
1. Virtual columns cannot be updated.
2. A virtual column cannot be of user defined datatype.
3. No DML's are allowed on virtual columns.
4. Virtual columns can only be created on normal tables and not on index organized or temporary tables.
Virtual column based partitioning:
SYNTAX:
CREATE TABLE <
(
COL1 datatype1,
COL2 datatype2,
COL3 [datatype] GENERATED ALWAYS AS <
)[TABLESPACE tablespace_name]
PARTITION BY <partition_type
(
PARTITION <
PARTITION <
PARTITION <
PARTITION <
);
Here we have used range partitioning method to partition a table.
No comments:
Post a Comment