Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cartesian join produces 0 records
Message
De
31/01/2006 19:25:29
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01091514
Message ID:
01092138
Vues:
18
Hi Sergey,

>What VFP version are you using?
VFP8 SP1

>The following code correctly returns 1 record in VFP9SP1.
>
>CREATE CURSOR Cursor1 (fld1 C(10) NULL, fld2 C(10) NULL)
>APPEND blank
>CREATE CURSOR Cursor2 (fld3 C(10) NULL, fld4 C(10) NULL)
>INSERT INTO Cursor2 VALUES (Null, Null)
>SELECT * FROM Cursor1, Cursor2 INTO CURSOR Cursor3>
Tried the above code, and I got the expected result of
RECCOUNT('Cursor3')=1. So this got me thinking... My Cursor2 had one record, but SELECT * FROM Cursor2 resulted in zero records. The purpose of Cursor2 was to create an empty cursor from a SQL table using SQLEXEC(lnHandle,[SELECT * FROM MyTable WHERE1=2],'Cursor2'), then I performed an APPEND BLANK in order to get a single record to join with Cursor1 to produce a single record in Cursor3. As soon as I fill any field in Cursor2 with some data, then perform the join, I get the expected result.

As your code above worked fine with APPEND BLANK, I suspect the problem lies with how Cursor2 was originally created using SQLEXEC. Is there something wrong with my thinking?

Regards,
Alan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform