Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
V6s5 - Creating Relations and their triggers programatic
Message
 
À
26/12/2003 08:49:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00862102
Message ID:
00862125
Vues:
17
Hi Hilmar

Thanks for responding. Actually the reason I wanted this is because I have fixed set of RI that I want to do at the first time the tables are created. I had a tough time dragging and dropping iid (PK) to ipid (FK) or iid to iitemid (FK) then right clicking that particular thread and calling VFP-RI builder.

I just want to mention:

DO genri WITH mAccounts, iID, tSaleBill, iPartyID, Cascade, Restrict, Ignore
DO genri WITH tSaleBill, iID, sSaleBillItems, iPID, Cascade, Cascade, Ignore

and my initial work is done. I dont mind running VFP-RI to do the actual dirty work.

Any ideas.

>
>To add procedures to the stored procedures, see APPEND PROCEDURES.
>
>To modify a trigger to a table, see CREATE TRIGGER.
>
>The actual trigger function for RI would have to search the key value, check in related tables, and return .T. or .F., depending on the type of trigger, and on whether the value is found.
>
>For example, for a delete trigger (in the parent table), if the value is found in child tables, the function should return .F. (DELETE is not allowed). Otherwise .T.
>
>For an insert or update trigger (in the child table), if the value is NOT found in the parent table, your function should reurn .F.
>
>
>If you want to redesign the RI completely, I have an idea that it might be interesting to use a single RI-function for all tables, and use a table-based approach. In other words, have your RI-function check a "relations" table, and search according to the parameters it finds there.
>
>Then, to redefine RI, you don't even need to recompile the stored procedures.
>
>
>On the other hand, I don't know whether such an effort is worthwhile; you can just as well use the built-in RI.
>
>Greetings,
>
>Hilmar.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform