history within perform

history within perform

Post by Bob E. Nur » Wed, 19 May 1993 22:23:35



Any ideas on how to impliment history within perform?

Would like to keep a row-by-row running history. That is, prior to when a row is
updated or deleted, it is saved. And, would like this to happen when using
perform. Sorry, don't have esql/c yet.

Example table:

item_id entry_date      other_columns...

  1     1/1/93
  2     1/2/93
  3     2/2/93
  1     2/5/93
  3     2/6/93
  .
  .
  .

Note the changes can be traced back in time by grouping on the item_id. Once
entered, the item_id never changes.

Can this be done within perform? Any better ideas on how to impliment history?

Thanks

Bob

P.S. The Daily SQL Quiz is being very helpful for grouping the data.

 
 
 

history within perform

Post by Jonathan Leffl » Thu, 20 May 1993 20:48:04


Quote:>From: uunet!da.hh.ab.com!ren (Bob E. Nurre)
>Subject: history within perform
>Date: 18 May 93 13:23:35 EST
>X-Informix-List-Id: <news.3370>

>Any ideas on how to implement history within perform?

>Would like to keep a row-by-row running history.  That is, prior to when a
>row is updated or deleted, it is saved.  And, would like this to happen
>when using perform.  Sorry, don't have esql/c yet.
> Example omitted...
>Note the changes can be traced back in time by grouping on the item_id. Once
>entered, the item_id never changes.

>Can this be done within perform? Any better ideas on how to impliment history?

Not easily, especially without ESQL/C.  The best solution would probably be
to use a 5.01 OnLine (or SE) engine and place triggers on the table so that
before any insert, delete or update, the information was logged as required.

Failing that, you would have to have ESQL/C and call a function from within
the form before insert, update, delete.  (Although 4.10 ISQL contains the
stuff required to buld a custom Perform, it does not, to the best of my
understanding, allow you to compile ESQL/C code -- only C code -- but
ESQL/C would be needed to do the logging.)  This technique is not reliable
because someone could create a form which does not call the function,
unlike the trigger solution.