Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01733: virtual column not allowed here

user1158410Nov 9 2011 — edited Nov 9 2011
Hello:

I have a view that when an INSERT statement is issued, I am getting the following error: ORA-01733: virtual column not allowed here. The INSERT statement is being issued against a view of one table and includes a case function in the SELECT section.

My question that I am researching is if it is possible to use a view this way when there is a case function being used in the SELECT Statement?*
Example:

DROP TABLE SYSADM.MARICOPA;
/
create table SYSADM.maricopa
as select ' ' AS "EMPLID", ' ' AS "A1", ' ' AS "A2" FROM DUAL;
/
DROP VIEW SYSADM.MARICOPA_VW;
/
CREATE OR REPLACE FORCE VIEW SYSADM.MARICOPA_VW
(
EMPLID,
A1,
A2
)
AS
SELECT A.EMPLID, CASE WHEN A.A1 = '1' THEN 'A' ELSE A.A1 END, A.A2
FROM SYSADM.MARICOPA A;
/
INSERT INTO SYSADM.MARICOPA_VW VALUES('99','99','99');
/
-- INSERT INTO SYSADM.MARICOPA_VW VALUES('99','99','99')
-- ORA-01733: virtual column not allowed here
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2011
Added on Nov 9 2011
2 comments
2,668 views