Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INSERT ... SELECT and row buffering, bug or not bug ?
Message
From
23/12/2004 02:22:38
Walter Meester
HoogkarspelNetherlands
 
 
To
22/12/2004 11:07:01
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00971447
Message ID:
00971689
Views:
32
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.

This behaviour probably is to be expected as this would make it consistent for INSERT INTO .... SELECT ... regardless of how many records are returned by the select statement. Otherwise you will have buffered data in the case only 1 record is returned or either only the last record added or none at all if multiple records are returned.

Walter,


>Run this indirect way, the record it is buffered:
>
>CREATE CURSOR PIVOT (FF I)
>APPEND BLANK
>
>CREATE CURSOR abba (f1 I)
>CURSORSETPROP("Buffering",3)
>
>SELECT TOP 1 00 FROM PIVOT ORDER BY 1 INTO ARRAY vv
>INSERT INTO ABBA FROM ARRAY vv
>? 'INSERT FROM ARRAY',GETFLDSTATE(-1),RECCOUNT()
>
>
>Run this direct way, the record it is updated:
>
>CREATE CURSOR PIVOT (FF I)
>APPEND BLANK
>
>CREATE CURSOR abba (f1 I)
>CURSORSETPROP("Buffering",3)
>
>INSERT INTO ABBA SELECT TOP 1 200 FROM PIVOT ORDER BY 1
>DEBUGOUT 'INSERT SELECT',GETFLDSTATE(-1),RECCOUNT()
>
>
>Bug,
>undoc behaviour
>doc behaviour ?
>
>Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform