Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong in my sql statement
Message
De
15/11/2000 13:20:28
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
What is wrong in my sql statement
Divers
Thread ID:
00442223
Message ID:
00442223
Vues:
50
When I have two Left outer join the sql statement does not work
here is the code I have used(When I remove depts table the code works)

**********************
procedure printrec
public lsqlhandle, lsqlstring, lsqlcursor, lsqlerror
lsqlhandle = sqlstringconnect("DSN=Visual FoxPro Database;UID=;PWD=;SourceDB=C:\tarun\basedata\Base1.dbc;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;")
if (lsqlhandle <= 0)
= MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
return
endif
lsqlstring = " SELECT Purchase.*, Accmst.accname, Depts.deptname;
FROM purchase LEFT OUTER JOIN accmst;
LEFT OUTER JOIN depts ;
ON Purchase.department = Depts.deptno ;
ON Purchase.partycode = Accmst.acccd"



lsqlcursor = "purreg01"
lsqlerror = sqlexec(lsqlhandle,lsqlstring,lsqlcursor)
=sqldisconnect(lsqlhandle)
if (lsqlerror <= 0)
= MESSAGEBOX('Cannot Execute SQL Command', 16, 'SQL Connect Error')
return
endif
sele &lsqlcursor
repo form purreg01 to printer prompt preview
sele &lsqlcursor
use
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform