Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL - INSERT INTO question. 1

Status
Not open for further replies.
Oct 21, 2002
22
US
Does VFP support this syntax of INSERT INTO?

INSERT INTO MyTable (field_1,field_2,...) SELECT field_1,field_2,... FROM MyOtherTable

I get a syntax error every time I try this command, whether it is performed on local VFP tables or on SQL/MySQL server tables (via SQLEXEC())

After doing a SCATTER MEMVAR I can do a

INSERT INTO MyTable (field_1, field_2,...) VALUES (?m.field_1,?m.field_2,...)

but I have gigabytes worth of data to transer on a fairly regular basis and I would love to simply select the data from the local tables and insert it into the appropriate SQL/MySQL servers tables.

Thanks for any help you can offer.

Gwen
 
Gwen
Add the work VALUES after the INSERT INTO MyTable

so it would be INSERT INTO MyTable VALUES () ...
 
Gwen,
Yes, VFP 8.0 added the
Code:
INSERT INTO MyTable (field_1,field_2,...) SELECT field_1,field_2,... FROM MyOtherTable
syntax. It wasn't available in earlier versions.

Rick
 
Rick, thanks for the quick reply. I guess I will have to get the company to spring for VFP 8.0. :)

Gwen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top