New Features of Oracle 11g (1)-virtual column, oracle11g

Source: Internet
Author: User

New Features of Oracle 11g (1)-virtual column, oracle11g

Database Version: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0-64bit

The Oracle11g introduces new features of virtual columns, which are described as follows:

1> You can only create virtual columns on the heap organization table (normal table). You cannot create virtual columns on the index organization table, External table, or temporary table.

2> the virtual Column cannot be of the LOB or RAW type.

3> the virtual column value does not actually exist. The virtual column value is calculated based on the expression only when it is used. It is not stored on the disk.

4> you can use virtual columns as partition keywords to create a partition table. This is another new feature of ORACLE 11g-virtual column partitioning.

5> you can create an index on a virtual column.

6> If a virtual column is added to a created table, if the field type of the virtual column is not specified, ORACLE automatically sets the field type based on the calculation results of the expressions following generated always.

7> the virtual column value is automatically calculated by ORACLE based on the expression. The UPDATE and INSERT operations cannot be performed, and the virtual column can be deleted.

8> all columns in the expression must be in the same table.

9> expressions cannot use other virtual Columns

-- Create a table with virtual Columns

SQL> create table test (n1 number, c1 varchar2 (80), n2 number generated always as (n1 * 0.8); -- create a partition table with virtual Columns

SQL> create table test1 (n1 number,

C1 varchar2 (80 ),

V1 varchar2 (2) generated always as (substr (c1, 1,1 )))

Partition by list (v1)

(Partition v11 values ('I '),

Partition v12 values ('O '),

Partition v13 values ('E '),

Partition v15 values (default ));

SQL> select * from test1 partition (v11 );

-- Create index SQL> create index inx_test on test1 (v1 );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.