Your cart
  • IMG
    {{cart_item.name}}
    {{cart_item.variation_attribute_name}}: {{cart_item.variation_attribute_label}}
    {{cart_item.item_unit}}: {{ setCurrency(cart_item.price)}}
    {{ setCurrency(cart_item.price*cart_item.quantity)}}
    Invalid quantity more than stock
Total :
{{setCurrency(cart.sub_total)}}

There is no item in the cart. If you want to buy, Please click here.

Table virtual column

Oracle Database Basic Course

Created by :
Database, Oracle
course
Programming, Software and application
1739
2020-12-07 03:13:23

A virtual column is a table column whose values are calculated automatically using other column values, or another deterministic expression.


Here is the syntax of a virtual column:

column_name [data_type] [GENERATED ALWAYS] AS (expression) [VIRTUAL]

In this syntax:

  • First, specify the name ( column_name) of the virtual column.
  • Second, specify the virtual column’s data type. If you omit the data type, the virtual column will take the data type of the result of the expression.
  • Third, specify an expression in parentheses after the AS keyword. The values of the virtual column will derive from the expression.
  • Note that the GENERATED ALWAYS and VIRTUAL keywords are for clarity only.


This statement shows how to define a virtual column in the CREATE TABLE statement:


CREATE TABLE table_name (
  ...,
  virtual_column_name AS (expression)
);

And this statement illustrates how to add a virtual column to an existing table using the ALTER TABLE statement:


ALTER TABLE table_name
ADD (
  virtual_column_name AS (expression)
);