am trying to use the query based notifications, but it seems to switch over to the object based notification for some reason. My environment is Oracle 11.2 ( I believe you need 11.1 or above for query based to work) and I have a select statement which retrieves a column which is of type NUMBER. (Again here my understanding is that only varchar2 and number columns work). I seem to get every change notification on the table and not just my flltered dataset
As an example I've created a sample table called test_db_notification with a single column of type NUMBER.
Added two entries in there as follows:
SELECT rowid,column1 FROM test_db_notification;
ROWID COLUMN1
AAAERnAAKAAEurNAAI 54
AAAERnAAKAAEurPAAA 63
Here's my code to register for notification:
OracleCommand _cmdObj = _connObj.CreateCommand();
_cmdObj.CommandText = " SELECT column1 FROM test_db_notification where column1 = 63";
_dep = new OracleDependency(_cmdObj);
_dep.QueryBasedNotification = true;
_dep.OnChange += new OnChangeEventHandler(_dep_OnChange);
_cmdObj.Notification.IsNotifiedOnce = false;
_cmdObj.AddRowid = true;
_cmdObj.ExecuteNonQuery();
When I register and change the value of column1 where the current value is 54, I get back a notification saying the ROWID for 54 has been updated.
I was expecting not to receive any notifications since my original query looks only at column1 = 63.
Am I missing something here?
Thanks