to add a table to an existing registration
The previous section describes how to use the change notification service to make
DatabaseIn the registration
Object(in the example above, the ORDERS
Table) is notified when a change occurs. However, from a performance perspective, client applications may prefer to cache order_items tables rather than ORDERS
The query result set for the table itself, because it has to retrieve only one row from the Orders table each time it accesses an order, but must also be from the Order_items
The table retrieves multiple rows. In the actual situation, the order may contain dozens of or even hundreds of order items.
Because you have registered a query on the ORDERS table, you do not have to create another registration to register the
The query for the Order_items table. Instead, you can use an existing registration. To do this, you first need to retrieve the ID of an existing registration. You can execute the following query to complete this
work:
SELECT Regid, table_name from User_change_notification_regs;
The results might look like this:
After you get the registration ID, you can use Dbms_change_notification. Enable_reg
The function adds a new object to the registration as follows:
It's done! From now on, the database generates a notification to respond to any changes made to ORDERS and Order_items, and calls
Orders_nf_callback process to handle notifications. So the next step is to edit orders_nf_callback so that it can handle the Order_items
The notification generated by the table to perform DML operations. Before recreating the Orders_nf_callback procedure, however, you need to create the following table types that will be referenced during the update process:
CREATE TYPE Rdesc_tab as TABLE of SYS. Chnf$_rdesc;
Then, return to the list
2, after the following line of code:
SendNotification (URL, tblname, ord_id);
Insert the following code:
http://www.bkjia.com/PHPjc/631000.html www.bkjia.com true http://www.bkjia.com/PHPjc/631000.html techarticle Adding a table to an existing registration section describes how to use the change notification service to cause a database to be notified when a change is made to a registered object (in the above example, the ORDERS table). But from ...