[V4RB] Bug in UPDATE or ImportText or Flush?
Richard Altenburg
valentina at brainchild.nl
Sun Mar 23 11:24:30 CST 2003
On 23-03-2003 09:17, "Richard Altenburg" <valentina at brainchild.nl> wrote:
> On 23-03-2003 09:07, "Richard Altenburg" <valentina at brainchild.nl> wrote:
>
>>> vcsImportGroup=New VCursor(ppPiPaBase, "SELECT groupname FROM AvailableGroup
>>> WHERE RecID=0")
>>>
>>> If (vcsImportGroup<>Nil) Then
>>>
>>> ppPiPaBase.ppAvailableGroup.Groupname.Indexed=False
>>>
>>> vcsImportGroup.ImportText(fdiTemp, " ", (Chr(13)+Chr(10)))
>>>
>>> ppPiPaBase.ppAvailableGroup.Groupname.Indexed=True
>>>
>>> ppPiPaBase.Flush
>>>
>>> rowsAffected=ppPiPaBase.SqlExecute("UPDATE AvailableGroup SET
>>> server_recid="+Format(serverIDInPopUpMenu, "############")+" WHERE
>>> server_recid=0")
>>>
>>> ppPiPaBase.Flush
>>>
>>> vcsImportGroup=Nil
After some thinking and testing, I came up with a temporary solution. After
the UPDATE of all the server_recid's for the records that had a server_recid
of 0, I do this:
rowsAffected=ppPiPaBase.SqlExecute("REINDEX FIELD
AvailableGroup.server_recid")
So I reindex the field that started the problems in the first place, and
this works all the time: at the start of a new database, after a small but
also after a big import. I imported 500,000 records from various server this
way and it worked all the time. The index was OK so the user could view the
newly groupnames for a given server as he was supposed to.
But reindexing so much records takes time, so this can only be a temporary
solution. I hope for a better, faster one, by Ruslan.
More information about the Valentina
mailing list