V4RB - UPDATE-Problem

Claudius Sailer Claudius at sailer-online.de
Thu Feb 10 17:02:09 CST 2005


Following works


   cmd="SELECT RecID, Betrag from Buchungen"
   CUR = tmpDB.SqlSelect(cmd, kV_Server, kV_NoLocks, kV_Random)

   ID=CUR.StringField("RecID")
   Betrag = CUR.StringField("Betrag")

   Ende=CUR.RecordCount

   For i=1 to Ende
     CUR.CurrentPosition=i
     cmd="UPDATE Buchungen SET BetragHerk="+betrag.getstring+", 
BetragZiel="+betrag.getstring+" WHERE RecID="+ID.getstring
     count=tmpDB.SQLExecute(cmd)
   next


but it is extremely slow :-((

bye


Claudius


Am 10. Feb 2005 um 16:12 Uhr schrieb Claudius Sailer:

> Hi Ruslan,
>
> Am 09. Feb 2005 um 20:22 Uhr schrieb Ruslan Zasukhin:
>
>>     curs = SqlSelect "SELECT ... WHERE ... "
>>
>>     f1 = curs.field("f1")
>>     f2 = curs.field("f2")
>>
>>     do
>>         f1 = f2
>>         curs.UpdateRecord
>>
>>     while curs.nextRecord
>>
>>     db.Flush()
>
> I had to change a little bit:
>
>   Dim count as integer
>   Dim CUR as VCursor
>   Dim Betrag, BetragHerk, BetragZiel as VField
>
>   //Felder bei Buchungen hinzufuegen
>   cmd="ALTER TABLE Buchungen ADD BetragHerk LONG NOT NULL"
>   count=tmpDB.SQLExecute(cmd)
>
>   cmd="ALTER TABLE Buchungen ADD BetragZiel LONG NOT NULL"
>   count=tmpDB.SQLExecute(cmd)
>
>   cmd="SELECT Betrag, BetragHerk, BetragZiel from Buchungen"
>   CUR = tmpDB.SqlSelect(cmd, kV_Server, kV_NoLocks, kV_Random)
>
>   Betrag = CUR.field("Betrag")
>   BetragHerk = CUR.field("BetragHerk")
>   BetragZiel = CUR.field("BetragZiel")
>
>   res=CUR.FirstRecord
>
>   do
>     BetragHerk = Betrag
>     BetragZiel = Betrag
>
>     res=CUR.Update
>
>   loop until NOT CUR.nextRecord
>
>   tmpDB.Flush
>
> BUT it doesn't work. Betrag is always nice value and BetragHerk and 
> BetragZiel is also changed, but it isn't rwitten to database. :-((
>
> bye
>
>
> Claudius
>
> -- 
> G4/733 QS / MacOS X 10.3.7de / RB 5.5.3de/ Valentina 1.10.0
> Homepage	http://www.ClaSai.de
> iChat		ryhoruk
> RealBasic ListBoxes: [ I feel the need...the need for speed!!! ]
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>



More information about the Valentina mailing list