Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add foreign key code problem
Message
 
 
To
08/09/2008 12:13:20
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:
01345800
Views:
25
>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.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform