Re: Informix triggers
Posted in 1993
In article <1993Jan20.165128.9762@dssmktg.uucp>, corinne@dssmktg.uucp (Corinne Gregory) writes: |> Hello, all... |> |> We are in need of using Informix 4GL (with Online?) in a live-feed |> sort of situation, where an "event" occurring which changes data in the |> database can be updated on the screen immediately. We are anticipating |> a live-flow of data that needs to be imported into the database and then |> activities performed within the 4GL program depending on the situation. I |> understand that triggers handle this situation nicely, but I have no |> experience with them in the Informix world. Do they exist? And, if yes, |> any suggestions, hints, etc., for how we would make use of them? |> |> Thanks for any help... |> |> - Corinne Corinne, Firstly, Triggers are only available in Online V5.01. This version is currently only available on the Sun platform. This version does not have a published porting schedule and the best info I can give you is that it will probably appear on the next set of major informix platforms sometime in Q1. Secondly, Triggers as I understand they have been implemented in Informix and most other RDBMS systems do not quite do what you want. As I understand it a trigger are written so that on insert/update/delete statements to a table a trigger can be activated. This trigger can check, using various techniques, the validity of the database change and reject or accept it. The techniques available are using a select statement, running a stored procedure. Now running a stored procedure allows you to do more than just check validity of an database change operation. It can make its own changes to the database based on the information provided in the original change or it can even run an external process. So you would need to write a program that would receive events and make some changes to the database. On the basis of these changes other changes can occur, external processes can be run and the integrity of the database can be checked all driven by triggers or by your updating program. 4GL has no ability to be interrupt driven nor does it have any concept of triggers as these are engine driven. So an external process run by a trigger could not directly change the data in a 4GL program. It could display the information in a status field of some kind. The way I have done this in the past is to use line 25 of dumb terminals as this does not get written over by 4GL screens. If you are using windowed systems you could create another window. If you are really clever you probably could write some IPC stuff in C and include this in the 4GL code at strategic places where the 4GL could redisplay the changed data. You still would have the problem of getting the data to change when the program was at a static point such as input statements. I hope this is of some help. Cheers - Jim -------------------------------------------------------------------- Name: Jim Gordon Internet: jgordon@ssf-sys.DHL.COM Company: DHL Systems Inc Phone: (415) 358-5911 (Work) Address: 1700 S. Amphlett Blvd. (415) 882-9728 (Home) San Mateo, CA 94402 Fax: (415) 571-6429 --------------------------------------------------------------------