Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Pass Thru, ADO or Remote Views?
Message
 
À
27/04/2004 12:20:33
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00898569
Message ID:
00898655
Vues:
12
>Hi Thomas
>
>I use multi-table joins all the time. Your lcFilter would have to reference aliases inside the SQL. Example:
>
>select oa.ord_id, it.itm_id from orders oa inner join items it on itm_ordid = oa.ord_id
>
>If your lcFilter referenced Orders and Items, it would crash.
>
>What does the SQL and lcFilter look like?

Mike;

Thank you for the idea. I am getting closer.

Works.
SQLEXEC(tConnection, 'SELECT R.ReworkNumber, R.Model, R.PartNumber, ;
							R.PartName, R.SupplierCode, R.SupplierName, ;
							R.Problem, ;
							TD.Kanban  ;			
						FROM Rework R, TallyDetail TD ;
						WHERE R.ReworkNumber = TD.ReworkNumber ;					
   			 			ORDER BY R.ReworkNumber DESC', 'rvLineCall')
Does not work using an INNER JOIN. Cannot save. See the ERROR below.
SQLEXEC(tConnection, 'SELECT R.ReworkNumber, R.Model, R.PartNumber, ;
							R.PartName, R.SupplierCode, R.SupplierName, ;
							R.Problem, ;
							TD.Kanban  ;			
						FROM Rework R INNER JOIN TallyDetail TD ;
						ON R.ReworkNumber = TD.ReworkNumber ;					
   			 			ORDER BY R.ReworkNumber DESC', 'rvLineCall')
Does not work using an AND statement. Cannot save. See the ERROR below. Hard coded Supplier Code.
SQLEXEC(tConnection, 'SELECT R.ReworkNumber, R.Model, R.PartNumber, ;
							R.PartName, R.SupplierCode, R.SupplierName, ;
							R.Problem, ;
							TD.Kanban  ;			
						FROM Rework R, TallyDetail TD ;
						WHERE R.ReworkNumber = TD.ReworkNumber ;	
						AND R.SupplierCode = “13041” ;				
   			 			ORDER BY R.ReworkNumber DESC', 'rvLineCall')
ERROR: Command contains unrecognized phrase/keyword.

I am accustomed to writing complex SQL expressions but have not tried to do so in SPT. I must be overlooking something that is right in my face and bit me but cannot recognize it!

By the way the SQL keywords (FROM, INNER JOIN, WHERE, ORDER BY) appear in blue and the AND statement is not – it is black.


Tom
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform