Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sqlexec Subquery Not Working
Message
De
18/04/2000 15:12:57
 
 
À
18/04/2000 14:32:17
John Mcdonald
Computers and Communications Ltd.
Deer Lake, Guatemala
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00360974
Message ID:
00361001
Vues:
16
>I am attempting to use sqlexec to compare local lookup table records with remote Oracle records. I am attempting to use the sql subquery "not in" clause to compare the local and remote records and retrieve those that do not exist in the local lookup tables. When I issue the command:
>
>lmrecs=sqlexec(mdbc,'select * from insurer where insurer_primary_key not in (sele insurer_pr from insurer_lookup)','temp')
>
>none of the records in the table are retrieved even though they do not exist in the local table. I have even cut and paste a working "not in" local subquery and this still does not return any records. Any suggestions?

The SQLEXEC() command is basically a string you pass to the back-end, which it then executes for you, and returns the result. The point is, the back-end knows nothing about your local table; it can't access it. Unless the Oracle DB has a table or view named "insurer_lookup", the command will fail. If the table/view DOES exist, it's likely not the same as your local one, so the results you would get would not be what you'd expect.

A simple but inelegant workaround would be to select all of the primary keys from the back-end to a local cursor, then run your SELECT locally with the two local cursors.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform