>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