[V4RB] speeding up UPDATE statements
Ruslan Zasukhin
sunshine at public.kherson.ua
Thu Jan 23 16:25:28 CST 2003
on 1/23/03 2:39 PM, Wonder Fef at wonderfef at noos.fr wrote:
Hi Wonder,
> I need to update several records (up to 1500 or more) in a go.
>
> As far as I know, I can only do it through a loop of UPDATE statement sent
> to the database with a SQLexecute. :
>
> Do
>
> myValue1 = "some value"
> myValue2 = "more value"
> myID = "abc"
>
> statement = "UPDATE myTable SET myField1 = '" + myValue1 + "',
> myField2 = '" + myValue2 + "' WHERE ID = '" + myID + "'"
>
> if myDatabase.SQLexecute(Statement) <> 1 then
> ///
> end if
>
> Loop until somethingMakesItExit
>
> It works fine, but slowly on Mac and *desperately* slowly on Windows.
>
> I'm using RealBasic v4.5.2 and Valentina PlugIn v.1.9.6
1) myField1 -- is string field and you do replace of string ?
2) am I right that you do this query for different myID ?
-----
You can try to be faster if do ONE SELECT to choose 1500 records,
Then iterate cursor and change fields of cursor and do
curs.Update()
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list