ORA-01733: virtual column not allowed here
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