Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add foreign key code problem
Message
From
31/08/2010 00:14:34
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01345791
Message ID:
01479356
Views:
32
So, you cannot se the Alter Table command to create just a simple index on a column. I don't have another table or column to reference, I just want an index. I like the Alter Table command, but it appears in this case you must just use Index On.

Correct?




>>Trying to define a table using code. Get a syntax error for "add foreign key" line of code.
>>
>>
>>	add table (gcPLANHOME+lcCHTABLE)
>>		
>>	use (gcPLANHOME+lcCHTABLE) in 0 excl
>>	select (lcCHTABLE)
>>	*remove plan table fields from new ch table
>>	alter table (gcPLANHOME+lcCHTABLE) drop column inid
>>	alter table (gcPLANHOME+lcCHTABLE) drop column indatetime
>>	alter table (gcPLANHOME+lcCHTABLE) drop column chid
>>	*keep chdatetime
>>
>>	ALTER TABLE (gcPLANHOME+lcCHTABLE) ADD COLUMN logid I
>>	ALTER TABLE (gcPLANHOME+lcCHTABLE) ADD COLUMN uwapprvl C(2)
>>
>>	alter table (gcPLANHOME+lcCHTABLE) add foreign key planid tag planid  && gets "syntax error"
>>	alter table (gcPLANHOME+lcCHTABLE) add foreign key logid tag logid
>>	alter table (gcPLANHOME+lcCHTABLE) add foreign key chdatetime tag chdatetime
>>
>>
>>Where is code wrong? Thanks.
>
>Your syntax is wrong. See Re: Where is the Syntax Error Thread #1287604 Message #1287608 You need to check the exact syntax of this command in Help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform