如何在Oracle DB中更新多个表? [英] how to update multiple tables in oracle DB?
本文介绍了如何在Oracle DB中更新多个表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在oracle 10g中使用了两个表.第一个表具有关键字count,id(主键),第二个表具有id时间戳.
i am using two tables in my oracle 10g. the first table having the keyword,count,id(primary key) and my second table having id, timestamp..
但是我在第一个表中执行任何更改(关键字,计数),这将反映在我的第二个表时间戳上.我正在使用id作为两个表的引用...
but i am doing any chages in the first table(keyword,count) it will reflect on the my second table timestamp.. i am using id as reference for both the tables...
表1:
CREATE TABLE Searchable_Keywords
(KEYWORD_ID NUMBER(18) PRIMARY KEY,
KEYWORD VARCHAR2(255) NOT NULL,
COUNT NUMBER(18) NOT NULL,
CONSTRAINT Searchable_Keywords_unique UNIQUE(KEYWORD)
);
表2:
CREATE TABLE Keywords_Tracking_Report
(KEYWORD_ID NUMBER(18),
PROCESS_TIMESTAMP TIMESTAMP(8)
);
如何通过引用另一个表来更新一个表.
how can update one table with reference of another table..
请帮助我...
推荐答案
在table1上使用插入或更新后触发器来管理table2.
Use an after insert or update trigger on table1 to manage table2.
这篇关于如何在Oracle DB中更新多个表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文