Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Create SQL VIEW REMOTE (gets all records!)
To create a view of a subset of remote data stored on a Linux server using MySQL, I use the following VFP 7 sample command:
OPEN DATABASE MyData
CREATE SQL VIEW MyView REMOTE CONNECTION MyRemote as ;
SELECT title FROM titles WHERE title=?xTitle Limit 10
(FYI the titles table has 1.5 million records and lots of fields)
The system then stalls (waits)...
When I examine a server process list (using the tool in MySQLFront), the server is busy processing the folling request:
SELECT * FROM titles <--- Yikes!
Obviously, this step is going to take a while to download this HUGE file. My question is why does VFP need to get all the records in the table when I am only CREATING the view? Is it the fact that "Limit 10" is not native to VFP? I can't use "TOP 10" because MySQL does not understand that. None of that should matter anyway because the first command VFP sends (by itself) is "SELECT * FROM titles"
I am wondering if VFP and MySQL are not compatible in some way (can anyone verify this situation on their system?). I have tried to solve this for months, and it seems odd that I am the only one out there who seems to be having an issue with such a basic operation. Help!
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement