Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's up with the UNION in VFP8?
Message
From
20/12/2002 06:59:39
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
What's up with the UNION in VFP8?
Miscellaneous
Thread ID:
00734822
Message ID:
00734822
Views:
42
Hi

I have a 2 UNION'd selects, that are taking an absolute age to process, I don't know if it is the SELECT generally, or if it's the UNION causing it.
	*Client Search
	SELECT UPPER(Client.Cl_Sname) AS Cl_Sname,;
		   UPPER(Client.Cl_Fname) AS Cl_Fname,;
		   Client.Cl_Dob,;
		   ALIAS.Al_Sname, ;		   
		   NVL(Property.pr_addr1, SPACE(20)) AS Pr_Addr1,;
		   NVL(Property.pr_pcode, SPACE(8)) AS Pr_Pcode,;
		   Client.Cl_Ref ;
	  FROM Client;
	  LEFT OUTER JOIN Property  ;
	    ON Client.pr_code = Property.pr_code  ;
	  LEFT OUTER JOIN ALIAS  ;
	    ON Client.Cl_Ref = ALIAS.Cl_Ref  ;
	 WHERE UPPER(Client.Cl_Sname) = tcCl_Sname ;
	   AND UPPER(Client.Cl_Fname) = tcCl_Fname ;
	   AND DTOC(Client.Cl_Dob) = tcCl_Dob;
	   AND UPPER(Property.Pr_Addr1) = tcPr_Addr1;
	   AND Property.Pr_Pcode = tcPr_Pcode;
	 UNION ;
	SELECT UPPER(Client.Cl_Sname) AS Cl_Sname,;
		   UPPER(Client.Cl_Fname) AS Cl_Fname,;
  		   Client.Cl_Dob,;
		   Alias.Al_Sname,;
		   NVL(Property.pr_addr1, SPACE(20)) AS Pr_Addr1,;
		   NVL(Property.pr_pcode, SPACE(8)) AS Pr_Pcode, ;
		   Client.Cl_Ref ;
	  FROM Alias ;
	 INNER JOIN Client ;
	    ON Alias.cl_ref = Client.cl_ref  ;
	  LEFT OUTER JOIN Property   ;
	    ON Client.pr_code = Property.pr_code ;
	 WHERE ALIAS.Al_Sname = tcCl_Sname   ;
	   AND ALIAS.Al_Fname = tcCl_Fname  ;
	   AND DTOC(Client.Cl_Dob) = tcCl_Dob ;
	  INTO CURSOR recClientList;
 		 ORDER BY 1,2
Any ideas?

Thanks
Kev
Next
Reply
Map
View

Click here to load this message in the networking platform