【发布时间】:2015-05-30 03:36:38
【问题描述】:
我有 2 个表,即 table1(id、name、address、contact_number、gender)和 table2(id、name、contact_number)使用 Oracle 11g XE。
在表 1 中,我有数据:(1,约翰,雅加达,123345,男性),(2,雷纳,万隆,568955,女性)。我想要基于 table1 到 table2 的数据,例如 (1, john, 123345), (2, reina, 568955)。
table1 有新数据后,如 (3, alfiano, Meda, 789654, male),table2 不存在重复数据(john 和 reina),只是添加 alfiano 数据值。
当我查询触发器时
select trigger_name, trigger_type, triggering_event, trigger_body from all_triggers where table_name = 'TABLE1'
在这种情况下,我有一个按钮来执行同步。但我不知道代码了。我正在使用 C#。
private void btnSync_Click(object sender, EventArgs e)
{
// i don't know the code
}
如何在这些表之间同步数据? 谁能推荐我?
【问题讨论】:
-
aminvincent,我们需要更多信息。您在 table1 上是否有更新
table2的触发器?如果是这样,请将触发代码添加到您的问题中。 -
@EdGibbs 在这种情况下,我有一个执行按钮,但我不知道代码....我正在使用 C#...你能建议我吗?
-
要检查您的 table1 上是否有任何触发器,请使用以下查询:
select trigger_name, trigger_type, triggering_event, trigger_body from all_triggers where table_name = 'TABLE1' -
很抱歉@aminvincent,但没有足够的信息来回答您的问题。如果您有更多信息,请发布。
-
@DmitryEgorov 我检查了table1中的触发器,但没有找到任何东西,..这意味着我没有触发器??