Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to run an sql script file?
Message
 
To
21/05/2001 11:44:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00509146
Message ID:
00509803
Views:
24
I usually work this process backwards, where I start by making the vfp sql statments in the vfp query editor, and then cut and past them into a Mysql editor, Then I have to rework them a bit to get them to run in try sql.

your problem is a little backwards, starting from try sql, into vfp's sql. so I understand the basics...but here a are a few things to look out for.
like I said the ; is not used the same, in sql, it indicates the end of the command, and in vfp, it indicates more commands on the next line.

also, the field types and nomenclature of the field types dont have a one to one relationship. ie. sql ansi 92 does not support memo type fields or logical type fields,

there can also be different types of interger fields, which are not supported by vfp.

text, is the clossest thing to a memo type field

You numeric type fields need to be looked at closeley as well.


One thing, and this is just thinking off the top of my head, and that is you could use odbc to convert them, heres what I am talking about.

send the sql statments to the server, using whatever server interface you have. then use vfp's sqlconnect() and sqlexec() commands to do something like this
sqlexec(1,"select * from mytable"mycursor")

that way you have cursor "mycursor" which not only has a good translation of field types, but also the data, with it, then you could save the cursor as a table.

That is, if you have access to the orig, sqltype server, and an odbc connection into it.


Bob Lee




>I found the reference in the MSDN Online Library. I'm going to fight for to fix my sql statements. Maybe you can help me again later.
>
>Thanks a lot!!!
In the beginning, there was a command prompt, and all was well.
Previous
Reply
Map
View

Click here to load this message in the networking platform