Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving field level changes to a table
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00310346
Message ID:
00310481
Views:
18
>Thanks I'll get it a try.
>
>The reason I don't like memo fields is that if I have to replace the field in the original table and it's a date or number or a whatever... I have to write a conversion back to the original type.

No matter how you implement this, I do not see how you can avoid doing this. Hence, my including a DataType field in the audit table. Otherwise, you will have to have a NewVal field for each data type. To me, that would be a bigger nightmare to search through. If you use a DataType and one NewVal field that is character, your Update trigger code can have a DO CASE:
DO CASE
   CASE AuditTable.DataType = "D"
        luRetVal = ctod(alltrim(AuditTable.NewVal))
   CASE AuditTable.DataType = "T"
        luRetVal = ctot(alltrim(AuditTable.NewVal))
   CASE inlist(AuditTable.DataType, "N", "I")
        luRetVal = val(alltrim(AuditTable.NewVal))
blah, blah, blah,
   OTHERWISE   && type is character
        luRetVal = alltrim(AuditTable.NewVal)
ENDCASE
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform