Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL update in VFP8
Message
From
14/06/2003 03:06:17
 
 
To
14/06/2003 02:25:28
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00799850
Message ID:
00800090
Views:
42
To all:
The solution to the problem is that a TableUpdate must be
issued after each Update in the loop.
This the problem appears not only with the SQL Update command but
also wilt SQl Delete etc.
In my case the solution was:

Scan
M_ CODE= temp_curs.Code
Update invhed Set katpel= m_sys WHERE invhed.Code=M_CODE
If ! Tableupdate(0, .T., "INVHED")
* message code
endif
Endscan

In general one must Tableupdate the table each time a record changes
or appended.
This is a major change from VFP7 to VFP8, and it should
have been documented from the very beginnig.
Practically I must review and change a lot in my code in order
to move from 7to8.

Yiorgos



>Hi jim,
>My original posting was:
>----------------------------------
>With VFP7 it takes less than a second to update the table.
>With VFP8 it takes more than 3 minutes
>I compiled the same project with VFP8 and reindexed the database using the
>Stonefield SDT tools.
>I recompiled the project again with VFP7 and runs, as usual,
>with the speed of light.
>What might be the problem ?
>
>** the code *********
>* the Temp_curs is a cursor of about 50 records
>* the Invhed is a table of a bout 250000 records
>* there INVHED table has an index on CODE field
>
>Begin Transaction
>m_sys=SYS2015()
>SELECT temp_curs
>Go Top
>Scan
>M_ CODE= temp_curs.Code
>Update invhed Set katpel= m_sys WHERE invhed.Code=M_CODE
>Endscan
>
>If ! Tableupdate(1, .T., "INVHED")
>=Messagebox(" Problem in updating: INVHED ", 16, oApp.Title)
>Rollback
>Return
>ENDIF
>
>End Trans
>------------------*
>The INVHED table has optomistic table buffering & multilocks
>
>
>
>>Yiorgus,
>>
>>Would you mind posting the cause in this thread and then marking it as the ANSWER so that others can benefit from the knowledge.
>>
>>thanks
>>
>>
>>>No. The cursor is not a local view. It is created with the CREATE CURSOR command.
>>>
>>>
>>>>>It seems that I have the same problem. see Thread ID: 799905
>>>>>
>>>>
>>>>Hi Yiorgos,
>>>>
>>>>I don't think this issue may affect TABLEUPDATE unless the cursor is a local view cursor and the base table is opened in table buffering mode (two levels of buffering are used - doesn't look like a good idea any way).
>>>>
>>>>Thanks,
>>>>Aleksey.
Previous
Reply
Map
View

Click here to load this message in the networking platform