Database Administration (MOSC)
MOSC Banner

Insert into table with virtual column using rowtype variable

edited Jun 23, 2011 2:07AM in Database Administration (MOSC) 1 commentAnswered
Hi,

I have created a table with virtual column,try to copy rows using select * into rowtypevariable from table, try to insert uning rowtypevariable. I get ORA-54013 occurwhen try to insert row using rotype variable

The following is the testcase executed in our test environment.
------------------------------------------------------------------------------------------------------------------------------------------------
SQL> create table my_table
    (id number not null
    ,id2 number not null
    ,constraint my_table_pk primary key (id)
    )
    /  2    3    4    5    6

Table created.

SQL> insert into my_table select rownum,rownum*2 from dba_objects where rownum <100;

99 rows created.

SQL> alter table my_table add (id3 number generated always as (id+id2) virtual);

Table altered.

SQL> declare

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center