Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLEXEC with Inner Join
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Firebird
Divers
Thread ID:
01234927
Message ID:
01234938
Vues:
8
>It doesn't say what is the exact error, next to the code is
>
>Select('CPAY')
>BROWSE
>
>The error that was raise is Alias 'CPAY' is not found, so by this, there is something wrong with my SELECT SQL.
>
>BTW, thanks for the sample code but it doesn't also work. I got invalid Token.
>
>
>TEXT TO lcSQL NOSHOW PRETEXT 15
>     SELECT TAlias1.PIF_NAME,
>            TAlias2.PIF_ID
>     FROM CLIENTS AS TAlias1
>     INNER JOIN PAYMENTS AS TAlias2 ON TAlias1.PIF_ID = TAlias2.PIF_ID
>ENDTEXT
>IF SQLEXEC(lnHandle, lcSQL , "CPAY") < 0
>   AERROR(laError)
>   MessageBox(laError[1,2])
>ENDIF
>
>
>But this modified code below works.....
>
>
>TEXT TO lcSQL NOSHOW PRETEXT 15
>     SELECT TAlias1.PIF_NAME,
>            TAlias2.PIF_ID
>     FROM CLIENTS TAlias1
>     INNER JOIN PAYMENTS TAlias2 ON TAlias1.PIF_ID = TAlias2.PIF_ID
>ENDTEXT
>IF SQLEXEC(lnHandle, lcSQL , "CPAY") < 0
>   AERROR(laError)
>   MessageBox(laError[1,2])
>ENDIF
>
Is it possible you set that connection to run queries Asynchronous?
What happens with this:
SQLSETPROP(lnHandle, [Asynchronous],.f.)

TEXT TO lcSQL NOSHOW PRETEXT 15
     SELECT TAlias1.PIF_NAME,
            TAlias2.PIF_ID
     FROM CLIENTS TAlias1
     INNER JOIN PAYMENTS TAlias2 ON TAlias1.PIF_ID = TAlias2.PIF_ID
ENDTEXT
IF SQLEXEC(lnHandle, lcSQL , "CPAY") < 0
   AERROR(laError)
   MessageBox(laError[1,2])
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform