Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record not selected by a SQL query
Message
 
 
À
08/11/2018 11:35:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01662848
Message ID:
01663230
Vues:
48
>>>>Do not rely on functions like recno() and deleted() when there are more than one table in the query.
>>>
>>>What about RECNO("kartei") or when a specific alias is specified. Does it work then?
>>>
>>No, as I said, never rely on recno() when it is not a single table in SQL. In one or more cases it might seem to work right, but I remember cases where it wouldn't. I just can't think of a good demo code right now.
>
>When I've needed RECNO() values, I've selected from the original table with something like:
>
SELECT RECNO() as nRecno, * FROM table INTO CURSOR c_table
>
>And then used that as the source for my subsequent query. Doesn't work well in views though, but can be a good workaround if it's manual code.

I wonder if something like this would be working for a view. I have not used views in a long time but could be interesting.
SELECT Test.Inv_Recno, Inv.Invnum, Par.Parnum 
    FROM (SELECT RECNO() AS Inv_Recno, Invnum, Parnum 
        FROM Inv 
        WHERE Parnum== "000001") Test 
    JOIN Par ON Test.Parnum == Par.Parnum 
    JOIN Inv ON Inv.Invnum == Test.Invnum AND Inv.Parnum == Test.Parnum 
    INTO CURSOR cuResult 
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform