当我尝试更新连接时,我收到“ORA-01779:无法修改映射到非键保留表的列”。我在网站上搜索并找到了很多关于保留密钥的含义以及为什么有必要的建议......但据我所知,我正在遵守该建议,但仍然出现错误。
我有两个表:
PG_LABLOCATION has, among other things, the columns:
"LABLOCID" NUMBER,
"DNSNAME" VARCHAR2(200 BYTE)
LABLOCID is the primary key, DNSNAME has a unique constraint
PG_MACHINE has, among other things, the columns:
"MACHINEID" NUMBER,
"LABLOCID" NUMBER,
"IN_USE" NUMBER(1,0) DEFAULT 0,
"UPDATE_TIME" TIMESTAMP (6) DEFAULT '01-JAN-1970'
MACHINEID is a primary key
LABLOCID is a foreign key into LABLOCID in PG_LABLOCATION (its primary key)
Run Code Online (Sandbox Code Playgroud)
我正在运行的更新是:
update
(select mac.in_use, mac.update_time
from pg_machine mac
inner join pg_lablocation loc
on mac.lablocid = loc.lablocid
where loc.dnsname = …
Run Code Online (Sandbox Code Playgroud)