Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving field level changes to a table
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00310346
Message ID:
00310481
Vues:
17
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform