Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INSERT ... SELECT and row buffering, bug or not bug ?
Message
De
24/12/2004 04:01:34
Walter Meester
HoogkarspelPays-Bas
 
 
À
23/12/2004 09:46:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00971447
Message ID:
00971997
Vues:
28
Hi Fabio,

>>I'd say this is undocumented behaviour. the INSERT in the first example is limited to inserting one record, the second does not have this limitation. Therefore I guess that the second implementation automatically updates any record that is inserted.
>
>Of course my choice of INSERT ... FROM ARRAY is not accidental.
>INSERT FROM ARRAY can add many records, and the last inserted still on the buffer.
>
>See this code:
>
>CLEAR
>CREATE CURSOR PIVOT (FF I)
>CURSORSETPROP("Buffering",3)
>APPEND BLANK
>APPEND BLANK
>? 'APPEND BLANK',GETFLDSTATE(-1) AT 30,RECCOUNT() && LAST IS 33
>TABLEUPDATE()
>
>CREATE CURSOR abba (ff I)
>CURSORSETPROP("Buffering",3)
>
>SELECT 0 FROM PIVOT INTO ARRAY vv
>? ALEN(VV,1) && TWO ROWS
>
>APPEND FROM ARRAY vv
>? 'APPEND ARRAY',GETFLDSTATE(-1) AT 30,RECCOUNT() && LAST IS 34
>
>INSERT INTO ABBA FROM ARRAY vv
>? 'INSERT FROM ARRAY',GETFLDSTATE(-1) AT 30,RECCOUNT() && LAST IS 34
>** OPERATION WITH TABLES
>APPEND FROM DBF('PIVOT')
>? 'APPEND TABLE',GETFLDSTATE(-1) AT 30,RECCOUNT() && LAST IS 11
>
>INSERT INTO ABBA SELECT * FROM PIVOT
>? 'APPEND TABLE',GETFLDSTATE(-1) AT 30,RECCOUNT() && LAST IS 11
>
>
I'm stumped about the INSERT INTO FROM ARRAY command. I though it would only insert one record, but it now seems that it supports multiple records at a time at least since VFP6. If I look at the helpfile here, it does say nothing about this capability too. I always used APPEND FROM ARRAY for accomplishing the same.

Anyways, I agree this should be documented better.

Walter,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform