Tuesday, March 21, 2017

ORA-01733: virtual column not allowed here

This error often occurs when you are trying to update a view that holds values from underlying base tables.

For example, you have a table STUDENT

STUDENT
firstName      lastName      streetAddress       city              state        zip
------------      ------------     -----------------      -----------      ------       ----------
John              Smith            1 main st.             Ocean          FL           33271
Mary             Shaw             2 pine st.              York            MD         07681


For convenience, you created a view STUDENT_VIEW

STUENDT_VIEW
name                                         address
-----------------------                   ----------------------------------------------
John Smith                               1 main st., Ocean, FL 33271
Mary Shaw                               2 pine st., York, MD 07681

The SQL below will cause the virtual column not allowed here error.

SQL> update STUENDT_VIEW set address = '3 main st., Ocean, FL 33271' where name = 'John Smith';

ORA-01733: virtual column not allowed here

To update John Smith's address, you need to update the STUDENT table instead of the STUDENT_VIEW.

-----------------------------------------------------------------------------------------------------------------
Watch the blessing and loving online channel: SupremeMasterTV live




If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book for free here.

No comments:

Post a Comment