@@ -19,14 +19,14 @@ what types of SQL should trigger a notification, whether notifications should
19
19
survive database loss, and control over unsubscription. You can also choose
20
20
whether notification messages will include ROWIDs of affected rows.
21
21
22
- By default, object-level (previously known as Database Change Notification)
23
- occurs and the Python notification method is invoked whenever a database
24
- transaction is committed that changes an object that a registered query
25
- references, regardless of whether the actual query result changed . However if
26
- the :meth: ` subscription <Connection.subscribe> ` option ``qos `` is
27
- :data: ` cx_Oracle.SUBSCR_QOS_QUERY ` then query-level notification occurs. In
28
- this mode, the database notifies the application whenever a transaction changing
29
- the result of the registered query is committed .
22
+ By default, object-level notification (previously known as Database Change
23
+ Notification) occurs. With this mode a Python notification method is invoked
24
+ whenever a database transaction is committed that changes an object referenced
25
+ by a registered query. However if the :meth: ` subscription
26
+ <Connection.subscribe> ` option ``qos `` is :data: ` cx_Oracle.SUBSCR_QOS_QUERY `
27
+ then query-level notification occurs. In this mode, the database notifies the
28
+ application whenever a committed transaction changes the result of a registered
29
+ query.
30
30
31
31
CQN is best used to track infrequent data changes.
32
32
@@ -109,7 +109,7 @@ calling :meth:`Subscription.registerquery()`. Registering a query behaves
109
109
similarly to :meth: `Cursor.execute() `, but only queries are permitted and the
110
110
``args `` parameter must be a sequence or dictionary.
111
111
112
- An example script to receive query notifications when the 'CUSTOMER ' table data
112
+ An example script to receive query notifications when the 'REGIONS ' table data
113
113
changes is:
114
114
115
115
.. code-block :: python
@@ -129,6 +129,7 @@ changes is:
129
129
subscr = connection.subscribe(callback = cqn_callback,
130
130
operations = cx_Oracle.OPCODE_INSERT | cx_Oracle.OPCODE_DELETE ,
131
131
qos = cx_Oracle.SUBSCR_QOS_QUERY | cx_Oracle.SUBSCR_QOS_ROWIDS )
132
+
132
133
subscr.registerquery(" select * from regions" )
133
134
input (" Hit enter to stop CQN demo\n " )
134
135
0 commit comments