FIX: Full Outer Join Returns No Records If One Table is Empty

Last reviewed: October 29, 1997
Article ID: Q161498
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 5.0

SYMPTOMS

The Full Outer Join SQL-SELECT command returns an empty result set when one of the tables or cursors is empty.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0a.

MORE INFORMATION

The Full Outer Join should return all the records from both tables or cursors. If one file is empty, then a Full Outer Join should return all the records from the other table.

Steps to Reproduce Behavior

Create a program file and add the following code:

   CREATE CURSOR cur1 (id_1 I(4), desc_1 C(20))
   CREATE CURSOR cur2 (id_2 I(4), desc_2 C(20))
   ** Places 10 records in cur1
   FOR l_n = 1 TO 10
      INSERT INTO cur1 (id_1, desc_1) VALUES (l_n, "TABLE1__"  + ;
       ALLTRIM(STR(l_n)))
   ENDFOR
   ** Performs full outer join
   SELECT * FROM cur1 FULL OUTER JOIN cur2 ON id_1 = id_2

The Browse window displays an empty result set.
Keywords          : buglist5.00 FxprgSql vfoxwin vfpfix5.0a kbprg kbbuglist kbfixlist
Version           : 5.0
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbfix


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.