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 を使用して別のテーブルに挿入する:

Insert into table2 (column1,column2,....) (rowid = retrived_rowid の table1 から column1,column2,.... を選択);

最初のテーブルの行 ID を使用して C# を使用して 2 番目のテーブルに挿入する場合は、アプリケーションでデータを永続化してから、配列/リストを読み取り、一度に 1 つのタプルずつデータを他のテーブルに挿入する必要があります。 . ODP.net には、バッチ モードでテーブルに複数の行を挿入する方法があります。

ROWID は物理的な行 ID であり、データベース内のタプルごとに一意であるため、取得した ROWID でのみ元のテーブルを更新できます。

于 2015-07-09T15:38:00.860 に答える