Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Assistance With SQL Command
Message
De
25/03/2008 17:49:42
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01305489
Message ID:
01305506
Vues:
6
Drop the NOT DELETED(). If you extend that by adding an alias, you'll get in trouble. If you have SET DELETED ON, that's all you need.

>I have an app that has this query. Note the ASCAN() command:
>
>
>SELECT rcm_pk, cmt_custname, rlc_number;
>	FROM RailComp, RailCars, CustMast;
>	WHERE rcm_rlc_fk = rlc_pk AND;
>		  rcm_custcode = cmt_custcode AND;
>		  NOT DELETED() AND;
>		  NOT rlc_final_bill AND;
>		  rlc_rectype = "R"  AND;
>		  ASCAN(laCustCode,custmast.cmt_custcode,1) > 0;
>	ORDER BY rcm_custcode, rlc_number, rcm_compdesc;
>	INTO CURSOR WouSel;
>
>
>
>I tried to change it to use a dynamically created cusstomer list, but I get a 'Line is too long' error when I
>select all customers:
>
>
>
>SELECT rcm_pk, cmt_custname, rlc_number;
>	FROM RailComp, RailCars, CustMast;
>	WHERE rcm_rlc_fk = rlc_pk AND;
>		  rcm_custcode = cmt_custcode AND;
>		  NOT DELETED() AND;
>		  NOT rlc_final_bill AND;
>		  rlc_rectype = "R"  AND;
>		  INLIST(rcm_custcode, 'ABCDE','ABL24','ACA30','ACM17');
>	ORDER BY rcm_custcode, rlc_number, rcm_compdesc;
>	INTO CURSOR WouSel;
>
>
>Is there a way to do this with a join?

Yes, but I'd have to rebuild your entire query to use JOIN syntax. ;)
SELECT rcm_pk, cmt_custname, rlc_number;
	FROM RailComp, RailCars, CustMast;
	INNER JOIN custcodeslist on rcm_custcode = custcodesList.rcm_custcode ;
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform