Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Problems in Remote Views
Message
De
09/07/1997 14:06:14
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00038988
Message ID:
00039134
Vues:
32
>>I'm going to try posting this to the "in general" category since there seems to be more traffic here, so please forgive the duplication.
>>
>>We have set up a VFP database on a remote server and are attempting to
>>access it via remote views. After establishing the connection to it and creating a new remote view, however, some odd things are happening.
>>
>>When I first add two tables from the database to my view, I am asked to create a join. So far so good. But when I set up the join, I find that it does NOT appear in the JOIN screen, but rather in the FILTER screen,which gives me undesired results. If I delete it and attempt to create the join using drag-and-drop, it STILL shows up in the FILTER screen. If I try to create the join manually on the JOIN screen, I get an ODBC error: "Command contains unrecognized phrase/keyword" on the "From" statement. This is the code the view is generating, and indeed this "from" statement looks very odd to me:
>>
>>SELECT Mainpatient.firstname, Mainpatient.lastname,;
>> Scdirectory.firstname, Scdirectory.lastname;
>> FROM {oj mainpatient Mainpatient LEFT OUTER JOIN SCdirectory
>>Scdirectory ;
>> ON Mainpatient.attendingmd = Scdirectory.dirid }
>>
>>This is a medical record system, and all I want to do here is create a
>>left outer join between my "mainpatient" table and my "SCdirectory"
>>table (which stores the names of physicians), so that I can view a list of patients and their physicians (linked by an id number). But the above code does not work.
>>
>>If I do this as a LOCAL view it works fine, and the code generated looks much more logical:
>>
>>SELECT Mainpatient.firstname, Mainpatient.lastname,;
>> Scdirectory.firstname, Scdirectory.lastname;
>> FROM general!mainpatient LEFT OUTER JOIN general!SCdirectory ;
>> ON Mainpatient.attendingmd = Scdirectory.dirid
>>
>>Since the SQL code is not editable in views, I'm really stuck here. What am I doing wrong??
>>
>>Thanks for any help.
>
>Jeffery, I had a similar problem, and we found it was caused by following the VFP 'wizard' when adding tables. VFP just kept storing the information in the wrong format. Try first adding the tables WITHOUT joins, then going into the JOIN tab and setting the links there. Doesn't take much longer.
>
>HTH
>Barbara

Thanks for the response, Barbara. Unfortunately no method I try seems have any effect on the generated SQL code... however I go about creating the join (I even used CREATE SQL VIEW from the command window), I end up with with the odd FROM statement... I'll have to keep plugging away.

Jeffery
Jeffery Cotton
Berdy Medical Systems
JVCotton@bellatlantic.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform