[V4RB] API Equivalent of UPDATE WHERE
Ruslan Zasukhin
sunshine at public.kherson.ua
Tue Jan 4 02:05:09 CST 2005
On 1/4/05 1:47 AM, "Frank Schima" <frank-list3 at mindstarprods.com> wrote:
>>>> * Also your task CAN be made with UpdateAllRecords() as I see.
>>>>
>>>> curs = db.SqlSelect(
>>>> "SELECT MyVarcharField WHERE MyVarcharField IS NULL"
>>>> )
>>>>
>>>> curs.VarCharField(x).valule = "someText"
>>>>
>>>> curs.UpdateAllRecords()
>>>
>>> Well i have some records with text that i want to preserve because
>>> it's
>>> different than 'some text'. I only want the NULL ones changed.
>>
>> Frank!
>>
>> But only NULL records will be selected in the cursor.
>> So only they will be updated.
>
> [Slaps head] Yes, of course - I get it now! Sorry for being dense (i.e.
> stupid). I'm so used to thinking in SQL terms and I'm trying to learn
> to use the nice new Valentina API more in place of SQL where possible
> for faster code.
Please note that THIS WAY (cursor.UpdateAll) will NOT add speed I think
Just it is little other SQL way based on the API of Vcursor class.
UPDATE WHERE is more powerful command although, because I can do with it
SET f = f + 1 WHERE f > 10
Curs.UpdateAll() can update all recs of cursor by THE SAME value.
Curs.UpdateAll() was in the 1.x also btw.
--
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://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina-beta
mailing list