Equivalent to PostgreSQL's LISTEN?
Posted in 2012
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Does Informix have an equivalent to PostgreSQL's LISTEN? With LISTEN I can watch for events, such as insert, on a table and get a notification when such an event occurs. Otherwise the application just sleeps on the idle socket (with some keep-alive). I want to monitor for when record(s) are inserted into a specified table and operate on them 'immediately'-ish. Searching the interwebz hasn't turned up anything [it is hard to come up with specific terms] and I don't see anything in the IBM documentation. IDS 11.10.UC1
What you need is the Change Data Capture (CDC) API. Your application code would register a callback on the table and events that you need to process using the API functions and then Informix will send a message to that function when the data change event occurs awakening it. Check out the Change Data Capture Programmers' Guide or the Informix Info Center for version 11.70 for details. Note that there are several IBM CDC products. The Informix CDC API, the DB2 CDC API, and an ETL tool called Change Data Capture which uses the API. the ETL tool is a for-charge utility, the Informix and DB2 APIs are included with Informix and DB2 respectively. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Mon, Jul 9, 2012 at 2:25 PM, Adam Tauno Williams <adam@morrison-ind.com>wrote: > Does Informix have an equivalent to PostgreSQL's LISTEN? With LISTEN I > can watch for events, such as insert, on a table and get a notification > when such an event occurs. Otherwise the application just sleeps on the > idle socket (with some keep-alive). > > I want to monitor for when record(s) are inserted into a specified table > and operate on them 'immediately'-ish. > > Searching the interwebz hasn't turned up anything [it is hard to come up > with specific terms] and I don't see anything in the IBM documentation. > > IDS 11.10.UC1 > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --14dae93405259d71cf04c469e314
How about checking out Informix auditing feature? Depending on what you want to do, it certainly can capture an insert statement on a specific table by a specific user or any user whenever this occurs. However, you need to be careful with "insert" since 100 thousand inserts can fill up your auditing directory. In addition, you can script such monitoring a little bit once audit finds such event so that you can get a notification including the detail of the query. ________________________________ From: Adam Tauno Williams <adam@morrison-ind.com> To: ids@iiug.org Sent: Monday, July 9, 2012 2:25 PM Subject: Equivalent to PostgreSQL's LISTEN? [27572] Does Informix have an equivalent to PostgreSQL's LISTEN? With LISTEN I can watch for events, such as insert, on a table and get a notification when such an event occurs. Otherwise the application just sleeps on the idle socket (with some keep-alive). I want to monitor for when record(s) are inserted into a specified table and operate on them 'immediately'-ish. Searching the interwebz hasn't turned up anything [it is hard to come up with specific terms] and I don't see anything in the IBM documentation. IDS 11.10.UC1 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
If you're just looking for notification; insert trigger -> calls a stored procedure -> makes a system call to a script Bob ----- Original Message ----- From: "Kern Doe" <kern_doe@yahoo.com> To: ids@iiug.org Sent: Monday, July 9, 2012 2:50:34 PM Subject: Re: Equivalent to PostgreSQL's LISTEN? [27574] How about checking out Informix auditing feature? Depending on what you want to do, it certainly can capture an insert statement on a specific table by a specific user or any user whenever this occurs. However, you need to be careful with "insert" since 100 thousand inserts can fill up your auditing directory. In addition, you can script such monitoring a little bit once audit finds such event so that you can get a notification including the detail of the query. ________________________________ From: Adam Tauno Williams <adam@morrison-ind.com> To: ids@iiug.org Sent: Monday, July 9, 2012 2:25 PM Subject: Equivalent to PostgreSQL's LISTEN? [27572] Does Informix have an equivalent to PostgreSQL's LISTEN? With LISTEN I can watch for events, such as insert, on a table and get a notification when such an event occurs. Otherwise the application just sleeps on the idle socket (with some keep-alive). I want to monitor for when record(s) are inserted into a specified table and operate on them 'immediately'-ish. Searching the interwebz hasn't turned up anything [it is hard to come up with specific terms] and I don't see anything in the IBM documentation. IDS 11.10.UC1 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.