Table Event Rules / Null Values

Inverso

Member
Hi Guys,

I'm currently writing some table event rules to create an audit trail for several of our tables. I've put some code into the "before update" event that fetches old values for a record being updated using a handle & compares these to the TK values. Where they are different, it creates a record in the audit table. However, I've spotted that a number of fields that are not being changed are showing up as being updated to blank. I'm pretty certain that my code works, so the only reason I can see (and my limitted knowledge of C++ debugging confirms this) is that the new values are null if they are not updated. I could just put in code to check if the new value is blank and ignore it if it is, but I would like to allow fields to be updated to null if the code tries to do this, but with it still being auditted. Another idea is to create a work file & put the old record values into there before the update, then compare them after the update to see the fields that have changed - though that would slow things down quite a bit with all the IO going on.

Has anyone come across this problem before / do you know if I am right about the null values / any ideas how to get round it?

Many thanks in advance,

John

[system info]
JDE Version - OneWorld B733 SP20
Fat Client - Win XP Pro
Thin Client - Citrix Metaframe XP on Win2K Server
UBE Servers - Win2K Server
Database - Oracle 10g on Win2K3 Server
[/system info]
 
What you're seeing is a known issue with OW TERs.
Don't try to use them as a real DB Trigger.
Instead write a Real DB Trigger (in Oracle DB). That approach works quite well and is low overhead.

Regards,
 
Hi Larry,

thanks for that - we were going to use TERs to make it easy for maintainers to see what was going on, but I've just stuck some comments in there telling them to look at database level.

Thanks again,

JB
 
Back
Top