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-01031 with update dual view

jmarcMar 25 2021

hello,
i work on database 19.3
i have an issue when i try to update a view that is related to another view that contain "dual", it works if i remove the dual view

i make a dumy testcase

CREATE TABLE "EBA_DEMO_IG_DEPT2"
( "DEPTNO" NUMBER,
"DNAME" VARCHAR2(60),
"LOC" VARCHAR2(40),
"NOTES" VARCHAR2(1000),
"MONTANT" NUMBER,
"PRIME" NUMBER,
PRIMARY KEY ("DEPTNO")
USING INDEX ENABLE
)
/

CREATE OR REPLACE FORCE EDITIONABLE VIEW "TEXTDUALVIEW" ("MM") AS
select 'mm' as MM from dual
/

CREATE OR REPLACE FORCE EDITIONABLE VIEW "TESTVIEW" ("DEPTNO", "DNAME", "LOC", "NOTES", "MONTANT", "PRIME") AS
select "DEPTNO" ,"DNAME" ,"LOC" ,"NOTES","MONTANT", "PRIME"
from EBA_DEMO_IG_DEPT2,TEXTDUALVIEW
/

CREATE OR REPLACE EDITIONABLE TRIGGER "TTESTVIEW" INSTEAD OF UPDATE
ON TESTVIEW
REFERENCING NEW AS new OLD AS old
FOR EACH ROW
BEGIN
null;
END;
/
ALTER TRIGGER "TTESTVIEW" ENABLE
/

update TESTVIEW set MONTANT=40 ;
gives ORA-01031: insufficient privileges
regards
jm

This post has been answered by mathguy on Mar 25 2021
Jump to Answer
Comments
Post Details
Added on Mar 25 2021
5 comments
581 views