i'm using an Amazon Work Space and i use a VPN to connect via SSH Ubuntu 16.04 instance. I use python to do a connection an Oracle Database 11g, i need to use cx_Oracle Continuous Query Notification and i founded this code looking on the internet from this page http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/oow10/python_db/python_db.htm:
import cx_Oracle
def DCNCallback(message):
print "Notification:"
for tab in message.tables:
print "Table:", tab.name
for row in tab.rows:
if row.operation & cx_Oracle.OPCODE_INSERT:
print "INSERT of rowid:", row.rowid
if row.operation & cx_Oracle.OPCODE_DELETE:
print "DELETE of rowid:", row.rowid
if row.operation & cx_Oracle.OPCODE_UPDATE:
print "UPDATE of rowid:", row.rowid
con = cx_Oracle.Connection("pythonhol/welcome@localhost/orcl",
events = True)
subscriptionInsDel = con.subscribe(callback = DCNCallback,
operations = cx_Oracle.OPCODE_INSERT | cx_Oracle.OPCODE_DELETE
| cx_Oracle.OPCODE_UPDATE,
rowids = True)
subscriptionInsDel.registerquery('select * from mytab')
raw_input("Hit Enter to conclude this demo\n")
I copied this example and tried to run on my Ubuntu instance, it does not have any error but when i insert/update/deleted some row on the oracle database nothing happened on the Ubuntu terminal.
What can i do ?