How do I call an external C function
Posted in 1999
Topics: General Discussion
I have a C function like this: int err; char buf[4096]; err = cfunc(buf); I would like to arrange for it to be called when a row is written to a certain table. Ideally, when the function returns, I would like to notify the calling process (the pid that wrote the row). What is the best approach? Something like PLEX for Oracle, where a program can write and read from a "dbms_pipe" would be also be fine. Please reply to parker@atlanta.com. - Randy
Randy J. Parker wrote: > > I have a C function like this: > > int err; > char buf[4096]; > > err = cfunc(buf); > > I would like to arrange for it to be called when a row is written to a > certain table. Ideally, when the function returns, I would like to notify > the calling process (the pid that wrote the row). > > What is the best approach? > > Something like PLEX for Oracle, where a program can write and read from a > "dbms_pipe" would be also be fine. Cannot do this in an Informix stored procedure/trigger. If you have IDS/UDO you could create a user function using "C" and call that but not in base Informix IDS. Art S. Kagel
Another way, is if you can wait and batch up the inserts, using a trigger and another table to store some index info for the row inserted. Then run the c functions from esql/c or 4gl from cron. Randy J. Parker wrote in message <78il6u$2ob@enews2.newsguy.com>... >I have a C function like this: > >int err; >char buf[4096]; > >err = cfunc(buf); > >I would like to arrange for it to be called when a row is written to a >certain table. Ideally, when the function returns, I would like to notify >the calling process (the pid that wrote the row). > > >What is the best approach? > >Something like PLEX for Oracle, where a program can write and read from a >"dbms_pipe" would be also be fine. > >Please reply to parker@atlanta.com. > >- Randy > > >