Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with referential integrity
Message
De
24/04/2002 13:13:27
 
 
À
24/04/2002 09:38:00
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Divers
Thread ID:
00648394
Message ID:
00648770
Vues:
17
This message has been marked as the solution to the initial question of the thread.
Denis:

>Could you expand a bit on that?

OK.

>I know that with business objects we can do lots of things but really to an extent that we don't need RI code in stored procedures?

Well, that's about the sum of it.

>If there are records in the parameterized cmCursor then delete button on the toolbar is disabled. Is that what you mean?

No.

Well, typical RI code will allow for cascading saves, cascading deletes etc., It tries to ensure that there is always integrity between related data sets. As far as Codemine goes, it couldn't be simpler. You have your CDE. You add a cursor to it and set it as the primary/default cursor. You then add other cursors. If you go into the builder for each added cursor and look at the "Relations" page, you can specify the "Parent cursor alias". You specify the parent keyfield and the foreign key field (generally for views only). In the RI options section of that page, you specify whether record(s) in this cursor should be deleted if/when the cursor's "Parent" record is deleted (cascading delete). You can have the cursor(s) requery its own records when its individual Parent record Moves. This type of setting can be specified in each and every cursor in a CDE. This creates a hierarchical set of cursors where in each cursor object you have specified its relationsip with its parent cursor. Obviously, any single cursor can have any number of other child cursors and so on.

Net effect, if you add new records, primary and foreign keys will be added, if you delete a parent record at any level, any cursors "down the line" will also automatically delete records so long as you want that to happen (as defined by the cursors properties). If you save a record, then the save ripples through too.

As far as I am concerned, there would be no way I would use DBC based RI over native Codemine RI - particularly version 7.

Obviously what you do is up to you but, it just seemed to me that you were missing the point on this one.

The only caveat, I suppose, is that if you use DBC based RI, if the tables are opened natively/interactively, then the RI *should* be effective whereas the CDE based RI occurs only when the CDE is actually instantiated.

Just my .02 penneth <s>.

-=Gary
-=Gary
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform