Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Year 0000
Message
 
 
À
15/04/2005 13:35:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01003937
Message ID:
01005313
Vues:
39
>This is possible only with a new native VFP :
>
>=AFLDCHANGE(aArray,[[WORKAREA|ALIAS],RECNO()])
>* return a 2 columns aArray: fieldname,changeFlag
>* changeFlag bit0 set if not === oldval
>*            bit1 set if not === curval
>* === equal with null
>
>
>>I'll try to explain the problem I'm having.
>>
>>In my table I have a table rule called UpdateUserAndTime and a trigger called _ri_handler("UPDATE"). First fires the table rule. Here I check for fields which were modified and if I find that it's a true modification (e.g. not the same value put in the field) I replace LastUpdateUser and time fields and don't check for the rest of the fields. Then the trigger code fires. At the top it would be nice to check, if either of PK or FK fields are changed (since these are the fields participating in relations). If none of these fields changed, I don't need to execute the rest of the trigger's code. So, what do you think? How can I save myself from executing code twice?
>
>I understand.
>
>A 1 second idea:
>
>* add a parameter to the trigger
>- _ri_handler("UPDATE","UpdateUserAndTime")
>within  _ri_handler:
>IF PCOUNT()=2 and !EVAL(m.cParam2) && call the routine, and put within it the PK FK test
>     RETURN
>ENDIF
>* change the name to a more generic name
>UpdateCheck
>
I tried to add this logic, but it slowed down the procedure considerably. I guess, I better not put it then.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform