Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add foreign key code problem
Message
From
08/09/2008 12:13:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Add foreign key code problem
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01345791
Message ID:
01345791
Views:
57
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.
Next
Reply
Map
View

Click here to load this message in the networking platform