I want to insert into the table, to which I swore:

ORA-54013: INSERT for virtual columns is prohibited ORA-02063: previous line from linkName

As I understand it, virtual columns are columns that are created on the fly from other columns. How to understand which columns to exclude from insertion?

  • Look at all_tab_columns , for sure there is something on this topic. And if you have a normal IDE, see the DDL table creation script right away. - Dmitriy

1 answer 1

You can look in the system dictionary, for example:

 create table tst1 (id number); alter table TST1 add v_id as (id*2); select t.column_name, t.VIRTUAL_COLUMN from all_tab_cols t where t.TABLE_NAME = 'TST1' and t.VIRTUAL_COLUMN = 'YES' 

Or you can see in your IDE. Most likely there should be displayed a schematic structure of the table or DDL scripts.

  • And how can you make an insert, bypassing these values? Suppose I have an insert: INSERT INTO TST2 SELECT COL1, COL2, VIRTUAL_COL3, COL4 FROM SOME_TABLE; And now remove the third virtual column. But without him he swears that there are not enough values, and with him that it is impossible to insert into a virtual column - Vitaly Yandulov
  • one
    You can try to explicitly list the columns in which you insert values - Viktorov
  • yes he did, but not so cool at all - Vitaly Yandulov
  • one
    Why not cool? On the contrary, cool. If the table structure changes for some reason, the old code will continue to work correctly. - Viktorov
  • Because there are more than a hundred columns there - you’ll get too tired to list x_x Oh well. Then the script is simple with the excel. - Vitaly Jandulov