Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tag name
Message
De
10/05/2001 16:53:19
 
 
À
10/05/2001 16:33:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00505997
Message ID:
00505999
Vues:
14
>Hello.
>
>Suppose that I know a relation in a database. I have in 4 variables the following info: Parent table name, Child table name, parent index and child index.
>
>I want to duplicate the relation in another database (assuming the parent and child tables exists, and they have the same indexes).
>
>The command I need is ALTER TABLE, but I can't figure out how to complete the command.
>
>In particular, I need the clauses noted below:
>
>
>ALTER TABLE child_table ADD FOREIGN KEY clause TAG clause FOR clause
>
I think you want the REFERENCES clause in the following (pasted from VFP6 Help):
ALTER TABLE TableName1
  [DROP [COLUMN] FieldName3]
  [SET CHECK lExpression3 [ERROR cMessageText3]]
  [DROP CHECK]
  [ADD PRIMARY KEY eExpression3 TAG TagName2 [FOR lExpression4]]
  [DROP PRIMARY KEY]
  [ADD UNIQUE eExpression4 [TAG TagName3 [FOR lExpression5]]]
  [DROP UNIQUE TAG TagName4]
  [ADD FOREIGN KEY [eExpression5] TAG TagName4 [FOR lExpression6]
     <b>REFERENCES TableName2 [TAG TagName5]</b>]
  [DROP FOREIGN KEY TAG TagName6 [SAVE]]
  [RENAME COLUMN FieldName4 TO FieldName5]
  [NOVALIDATE]
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform