Insert record into oracle after virtual column definition

So, I noticed that after defining the virtual column in oracle, I was unable to insert without mentioning the name of the specific column. Is there any documentation about this?

for example: - Without a virtual column definition, the following works:

INSERT INTO film VALUES ('12F', 'Full Screen', 2015);

      

However, as soon as I define a virtual column named number (which stores the number of the number from number_key) like below:

ALTER TABLE film ADD (number AS (substr(number_key,1,2)));

      

I am unable to add records using the above insert statement, I am getting an error:

 SQL Error: ORA-00947: not enough values
 00947. 00000 -  "not enough values"

      

I need to explicitly specify the column names in my insert queries. Why is this so? I see something here, something.

+3


source to share


1 answer


We seem to expect that we should define the column names for inserts. More information can be found here .



+4


source







All Articles