Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get foreign keys
Message
De
07/06/2022 05:27:36
Lutz Scheffler (En ligne)
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
07/06/2022 05:08:35
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01684430
Message ID:
01684442
Vues:
33
>>Hi All,
>>
>>while trying to fix a corrupted DBC I need to redo some indexes. There is just the DBC, nothing else. While I know to get the information about the tags via ATAGINFO(), how do I get information about foreign keys? This is odd. I know I can mimic low level through the DBC, but is there nothing build in?
>
>Found this in my gen_dex.prg:
>
	nTotal_Relations = ADBOBJECTS(aAll_Relations, "Relation")
>	lcRelString=""
>	FOR m.nLoop = 1 TO m.nTotal_Relations
>		lcRelString = lcRelString + c_Tab + c_Tab + "ALTER TABLE '" + aAll_Relations[m.nLoop,1] +;
>			"' DROP FOREIGN KEY TAG " +;
>			aAll_Relations[m.nLoop,3]  + crlf
>	ENDFOR
>
>...which is the part which reads them from the dbc and generates code to drop them; then this generates code to recreate them:
>
	lcRelString=""
>	FOR m.nLoop = 1 TO m.nTotal_Relations
>		lcRelString = lcRelString + c_Tab + c_Tab + "ALTER TABLE '" + aAll_Relations[m.nLoop,1] +;
>			"' ADD FOREIGN KEY TAG " +;
>			aAll_Relations[m.nLoop,3] +;
>			" REFERENCES " + ;
>			IIF(" " $ aAll_Relations[m.nLoop,2], ["], []) + ;
>			aAll_Relations[m.nLoop,2] +;
>			IIF(" " $ aAll_Relations[m.nLoop,2], ["], []) + ;
>			" TAG " + aAll_Relations[m.nLoop,4] + crlf
>	ENDFOR
>
Hi Dragan!

Thank you, looks close. :)

Lutz
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform