I've had a request for an "audit trail" for a SQL Server based 
application. I've gotten triggers set up in the database that logs all 
changes, and records the field name, plus old/new values for 
comparision. This is, as usual, an "add on" request after all other work 
was finished and never in the original spec. Oh, they'll pay, but that's 
not the problem...

The client wishes to be able to view the audit trail for any specific 
record between various dates and various other blah, blah, search criteria.

No problem here.

OK, what's now giving me a fit is that they don't want to see the 
database field name, but the label that's on the original form. So, in 
my "audit table", I've got stuff like:

field_name      action          old_value       new_value
IV_1_predef     Update          whatever        new whatever
VIA1_PPA        Update          whatever        new whatever
II_B_dtON_d     UPdate          whatever        new whatever

This stuff span eight tables and several hundred fields

OK, in code, what would you think the most compact/fastest way to match 
up the "field_name" and the label name for display purposes?

All I can think of is to set up a huge array:

<cfset fldlst[1][1]="IV_1_predef"> (field name)
<cfset fldlst[1][2]="Predefined System...blah"> (label name)

.... and then loop through it looking through matches in 
audit_table.field_name.

Seeing that you could end up looping through the entire array dozens of 
times just to display one set of results - don't seem too good.

Anybody got any other ideas?







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280417
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to