4

Handling RowID's returned as part of DB events through a listener:

class DCNDemoListener implements DatabaseChangeListener
    {
      DBChangeNotification demo;
      DCNDemoListener(DBChangeNotification dem)
      {
        demo = dem;
      }
      public void  onDatabaseChangeNotification(DatabaseChangeEvent e)
      {
        System.out.println(e.toString());
      }
    }

For Example: Below are the values returned from database on DML operation

ROW: operation=UPDATE, ROWID=AAASjgAABAAAVapAAA

Using the above ROWID's I want to update/insert into another table in database. How do I do this? Do I have first store the RowId's in cache or is there any other way to insert/update using queries

4

1 回答 1

0

使用 SQL 插入另一个表:

插入 table2 (column1,column2,....) (select column1,column2,.... from table1 where rowid = retrived_rowid);

如果您想使用 C# 使用第一个表中的 rowid 插入到第二个表中,您必须以某种方式将数据持久保存在您的应用程序中,然后读取您的数组/列表并将数据一次插入另一个表中的一个元组. ODP.net 中有一种方法可以将多行以批处理模式插入到表中。

您只能使用检索到的 rowid 更新原始表,因为 rowid 是物理行标识符,并且它对于数据库中的每个元组都是唯一的。

于 2015-07-09T15:38:00.860 回答