Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to run an sql script file?
Message
From
21/05/2001 13:31:28
 
 
To
21/05/2001 11:03:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00509146
Message ID:
00509578
Views:
17
>I want to run SQL DDL statements over a VFP database, not a ODBC database, I mean, create tables in VFP using DDL statements like create table, alter table, add column, create index etc.
>
>If I try to execute this statement in the command window:
>alter table MyTable add primary key (Field1, Field2, Field3)
>I get an error:
>Function name is missing ).
>
>I was wandering too, if I can execute a complete sql script, instead line by line. Something like Oracle instruction @c:\script.sql
>>>>>>>>>>>


I misunderstood then. In VFP you write:
alter table MyTable add primary key Field1
That should work.

As per your other question, I don't do Oracle, but I do not think you can run a sql script. What you can do, in VFP7 is use EXECSCRIPT(cExpression [, param1, param2..]) to run a VFP script that could contain several ALTER TABLE, etc.

HTH


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform