postgres=# \c warehouse_db You are now connected to database "warehouse_db" as user "postgres".warehouse_db=# set search_path ='record';SETwarehouse_db=# show search_path ; search_path ------------- record(1 row) warehouse_db=# create…
今天同事让我看一个触发器为什么老是报错,当执行DML语句触发触发器后,会报ORA-04091错误:ORA-04091: table xxxx is mutating, trigger/function may not see it .对应的中文错误提示为:ORA-04091: 表 xxx发生了变化, 触发器/函数不能读它. 原因分析: [oracle@DB-Server ~]$ oerr ora 409104091, 00000, "table %s.%s is mutating, trigge…
今天在论坛里发现了一个关于ORA-04091的老帖子,收获良多,特此整理一下 关于ORA-04091: table is mutating, trigger/function may not see it的分析 当DML操作触发trigger的时候,如果trigger的程序块中需要对当前表进行修改或查询的时候,就会报错ORA-04091: table is mutating, trigger/function may not see it 这是有在被触发TRIGGER工作的时候,默认把当前表表锁…
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 Connected as tbcs SQL> SQL> SQL> drop trigger tbcs.TRG_CJW_TEST; drop trigger tbcs.TRG_CJW_TEST ORA-04080: trigger 'TRG_CJW_TEST' does not exist SQL> drop table tbcs.cjw_te…
warehouse_db=# CREATE TABLE warehouse_tbl(warehouse_id INTEGER NOT NULL,warehouse_name TEXT NOT NULL,year_created INTEGER,street_address TEXT,city CHARACTER VARYING(100),state CHARACTER VARYING(2),zip CHARACTER VARYING(10),CONSTRAINT "PRIM_KEY"…