1) Please make sure every table has a single column primary key.
2) Fields you use in WHERE clause need to be either primary key or indexed fields.
3) Also use this statement before starting your loop:
- Code: Select all Expand view
oCn:SetAutoCommit( .f. )
After end of loop
- Code: Select all Expand view
oCn:SetAutoCommit( .t. )
4) Such large export of data should be attempted on local server.
5) Increase max_allowed_packetsize suitably and concatenate more than one update statement with ";" so that the total size of the combined sql does not exceed 80% of the max_allowed_packetsize. Then execute multiple query at a time instead of executing each update query separately.