Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Correlated Query help
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00494635
Message ID:
00494778
Vues:
20
>Hi All,
>This works in SQL Server, however VFP cannot handle the complexity. :( I'm not sure how to rewrite it.
>SELECT S.Clm_Id, S.Svc_Dt ;
>	FROM Mc_MdSvc S, Mc_MdClm C ;
>	WHERE C.Adjt_Stat = "Z" ;
>	AND C.Clm_Id = S.Clm_Id ;
>	AND NOT EXISTS (SELECT * FROM Mc_PlnHs P ;
>				WHERE P.Mem_Num = C.Mem_Num ;
>				AND P.Active_Ind = .T. ;
>				AND P.Pln_Id = C.Pln_Id ;
>				AND P.Ins_Id_Num = C.Ins_Id_Num ;
>				AND P.Eff_From <= S.Svc_Dt ;
>				AND P.Eff_Thru >= S.Svc_Dt)
>
SWAG, try:
>SELECT S.Clm_Id, S.Svc_Dt ;
	FROM Mc_MdSvc S, Mc_MdClm C ;
	WHERE C.Adjt_Stat = "Z" ;
	AND C.Clm_Id = S.Clm_Id ;
	AND NOT EXISTS (SELECT * FROM Mc_PlnHs P ;
				WHERE P.Mem_Num = C.Mem_Num ;
				AND <b>P.Active_Ind</b> ;
				AND P.Pln_Id = C.Pln_Id ;
				AND P.Ins_Id_Num = C.Ins_Id_Num ;
				AND <b>S.Svc_Date BETWEEN P.Eff_From P.Eff_Thru</b> )
If it's a matter of receiving a SQL Statement Too Long or Insufficient Stack Space error, try increasing the complexity value using SYS(3055), which controls the evaluation of WHERE and FOR clauses - the default value is 320, and can be set to a value between 320 and 2048 (bigger means a more complex query can be handled) for example:

=SYS(3055,1024)


>What it chokes on is the last 2 lines of the subquery. It only can handle equality. Any Ideas?
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform