Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DBC's Referential Integrity
Message
De
05/11/1998 07:37:15
Roberto Cysne
Banco do Nordeste S.A.
Fortaleza, Brésil
 
 
À
03/11/1998 10:52:33
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00153861
Message ID:
00154742
Vues:
18
Hi, Nancy,

Thanks for your help.



>Hi, Roberto:
>
>Here's some code I've been playing with. It's intended to initialize the foreign keys in tables. It uses the idea that I think you are talking about.
>
>FUNCTION GetParentID
>LPARAMETER cParentAlias
>IF PCOUNT() < 1 .OR. ;
>   TYPE( cParentAlias + '.id' ) <> 'U'
>	RETURN .NULL.
>ENDIF
>cChildAlias = IIF( PCOUNT() < 1, ALIAS(), UPPER( cChildAlias ) )
>DIMENSION aRI[1]
>SET DATABASE TO (CURSORGETPROP( 'database', cChildAlias ))
>ADBOBJECTS( aRI, 'Relation' )
>LOCAL ni, cChildKey, cParentKey
>FOR ni = 1 TO ALEN( aRI, 1 )
>	IF aRI[ni,1] = cChildAlias .AND. ;
>	   SUBSTR( aRI[ni,5], 3, 1 ) = 'R' .AND. ;
>	   USED( aRI[ni,2] )
>		SELECT (aRI[ni,2])
>		SET ORDER TO (aRI[ni,4])
>		cParentKey = TRIM( KEY() )
>		SET ORDER TO
>		SELECT (cChildAlias)
>		SET ORDER TO (aRI[ni,3])
>		cChildKey = TRIM( KEY() )
>		SET ORDER TO
>	   REPLACE (cChildKey) WITH ;
>	   		   EVAL(aRI[ni,2] + '.' + cParentKey) IN SELECT(cChildAlias)
>	ENDIF
>NEXT ni
>RETURN
>
>
>>>>Is there some way to list the DBC’s referential integrity by a program ?
>...snip
>>DBGETPROP() is Ok for Triggers and other properties, but I specific refer to the relation integrity type between the tables of a DBC. (one to one, one for many, etc…)
Roberto Cysne Costa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform