Kbase P1986: Is it possible to audit database activity from the 4GL?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/16/2008 |
|
Status: Verified
GOAL:
Is it possible to audit database activity from the 4GL?
FACT(s) (Environment):
Progress 8.x
Progress 9.x
OpenEdge 10.0x
FIX:
Progress has no built-in tool to trace the activity on the database from the 4GL in releases prior to 10.1A.
You can use database triggers (CREATE, WRITE and DELETE) for the tables you are interested in monitoring.
The following sample code gives an idea of what the triggers might look like (i.e. this is not working code, it is merely designed to give the developer an idea of what to do).
/* traceCreateCust.p */
TRIGGER PROCEDURE FOR CREATE OF customer.
/* Write an audit record to the traceTable database table */
/* whenever a new record is created. */
CREATE traceTable.
ASSIGN traceTable.tSequence = NEXT-VALUE(traceSequence)
traceTable.tUserID = USERID
traceTable.tDate = DATE
traceTable.tTime = TIME
traceTable.tActivity = "Create"
traceTable.tTableName = "Customer"
traceTable.tRowID = ROWID(customer).