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!

Running sql scripts in text files -vfp6 1

Status
Not open for further replies.

foxbldr

Programmer
Apr 16, 2002
109
CA
Hi all,

I have bunch of text files that contain sql statements:

ie. contents of Loan.txt (command continuation added at eol)

select ......,........,;
from .................. ;
where ..... ;
order by .., .. into cursor ....

Can somebody suggest me an efficient way of executing queries without reformatting contents (conforms to VFP6 sql) of txt files.

Foxbldr


Foxbldr






 
VFP 8 or above
Code:
SET ENGINEBEHAVIOUR 70
EXECSCRIPT(FILETOSTR([Loan.txt]))
SET ENGINEBEHAVIOUR 90

VFP 7 or smaller
Code:
COPMPILE Loan.txt
DO Loan.fxp
ERASE Loan.fxp


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Hi BB,

Thanks for your suggestion and that method eases most of subsequent coding in my project.

Foxbldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top