how to let IDS engine push out queried data ?
Posted in 2012
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Triggers, Constraints & Referential Integrity
Greeting !! A table A in IDS 11.5 can have a trigger so that each time Table A is inserted,updated or deleted , the trigger is executed !! I like to let that trigger to inform a esql/c application in the same machine to know those conditions happened , is there a way allow me to do that in IDS trigger ? So far I use a esql/c in an endless loop ,with usleep(50) to make a select to table A to see if data changed , but if I can have a trigger in table A to inform a esql/c ap , no matter through socket way , queue or shared memory , all will be fine , I think that would be more efficient than what I do now ... Any suggestion is appreciated !! Thanks !
Hi Mars, something like that could be done by invoking a stored procedure written in JAVA, which allows you to do almost anything. But take care about timeouts when you start up a network connection, maybe start a new thread to do it asynchronous (or build your logic which is in the ESQL/C in the stored procedure if possible). Marcus ----- Ursprüngliche Mail ----- Von: "MARS CHEN" <hedgezzz@yahoo.com.tw> An: ids@iiug.org Gesendet: Mittwoch, 6. Juni 2012 10:05:28 Betreff: how to let IDS engine push out queried data ? [27296] Greeting !! A table A in IDS 11.5 can have a trigger so that each time Table A is inserted,updated or deleted , the trigger is executed !! I like to let that trigger to inform a esql/c application in the same machine to know those conditions happened , is there a way allow me to do that in IDS trigger ? So far I use a esql/c in an endless loop ,with usleep(50) to make a select to table A to see if data changed , but if I can have a trigger in table A to inform a esql/c ap , no matter through socket way , queue or shared memory , all will be fine , I think that would be more efficient than what I do now ... Any suggestion is appreciated !! Thanks ! ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Thank you ,Marcus ... That information help a lot !!
Take a look at the Change Data Capture API (CDC). With it you can register an application to be notified when data changes. This is lower overhead than using triggers for the same effect. To do it with triggers, you would write a C or Java UDR that would be called from within the triggers that would send a signal to your application or push a data block out a pipe to it. 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 Wed, Jun 6, 2012 at 4:05 AM, MARS CHEN <hedgezzz@yahoo.com.tw> wrote: > Greeting !! > > A table A in IDS 11.5 can have a trigger so that each time Table A > is inserted,updated or deleted , the trigger is executed !! > > I like to let that trigger to inform a esql/c application in the same > machine > to know those conditions happened , is there a way allow me to do that > in IDS trigger ? > > So far I use a esql/c in an endless loop ,with usleep(50) to make a > select to table A to see if data changed , but if I can have a trigger > in table A to inform a esql/c ap , no matter through socket way , queue or > shared memory , all will be fine , I think that would be more efficient > than what I do now ... > > Any suggestion is appreciated !! Thanks ! > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --14dae9340e1be86fc204c1cbe223
Why Java? You could do it in C, too. It would be more efficient, especially if you're already writing C. On 6 Jun 2012, at 09:13, Marcus Haarmann wrote: > Hi Mars, > > something like that could be done by invoking a stored procedure written in > JAVA, which allows you to do almost anything. > But take care about timeouts when you start up a network connection, maybe > start a new thread to do > it asynchronous (or build your logic which is in the ESQL/C in the stored > procedure if possible). > > Marcus > > ----- Ursprüngliche Mail ----- > > Von: "MARS CHEN" <hedgezzz@yahoo.com.tw> > An: ids@iiug.org > Gesendet: Mittwoch, 6. Juni 2012 10:05:28 > Betreff: how to let IDS engine push out queried data ? [27296] > > Greeting !! > > A table A in IDS 11.5 can have a trigger so that each time Table A > is inserted,updated or deleted , the trigger is executed !! > > I like to let that trigger to inform a esql/c application in the same machine > to know those conditions happened , is there a way allow me to do that > in IDS trigger ? > > So far I use a esql/c in an endless loop ,with usleep(50) to make a > select to table A to see if data changed , but if I can have a trigger > in table A to inform a esql/c ap , no matter through socket way , queue or > shared memory , all will be fine , I think that would be more efficient > than what I do now ... > > Any suggestion is appreciated !! Thanks ! > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. >