Subject | Re: [IBO] Trouble posting changes to a multirecord dataset |
---|---|
Author | mspencewasunavailable |
Post date | 2006-11-01T13:14:30Z |
--- In IBObjects@yahoogroups.com, Ramil <khabibr@...> wrote:
something)? From his attempt at speeding things up, WS_REPEAT_REASON
is the same for all of the records referenced by Dataset. So
wouldn't it be possible to just execute something like this:
UPDATE <table> SET WS_REPEAT_REASON = :ACTIVITY_ID
WHERE <whatever criteria were used in the first place>
using a TIB_Query or a TIB_Statement?
Michael D. Spence
Mockingbird Data Systems, Inc.
>record
> Check IB_Cursor1.RequestLive is True
> and don't forget about Transactions.
>
> I have this working fine:
>
> IB_Transaction1.StartTransaction;
> try
> // it's necessarily for opening cursor and going to the first
> IB_Cursor1.First;one
>
> while not IB_Cursor1.Eof do
> begin
> IB_Cursor1.Edit;
> IB_Cursor1.FieldByName('ABC').AsString:='123';
> // IB_Cursor1.Fields[1].AsString:='123'; is a little faster
> IB_Cursor1.Post;
> IB_Cursor1.Next;
> end;
> IB_Transaction1.Commit;
> except
> IB_Transaction1.RollBack;
> end;
>
> I have checked up.
>
> Ramil
>
> >
> >
> >
> >
> >
> > Hi,
> >
> > I'm working on a large application that does all of it's saving
> > record at a time. Basically the code is like this.RepeatReason;
> >
> > Dataset.Close;
> > Dataset.ParamByName('ACTIVITY_ID').AsInteger := ActivityId;
> > Dataset.Open;
> >
> > Dataset.Edit;
> > Dataset.FieldByName('WS_REPEAT_REASON').AsString :=
> > Dataset.Post;saving is
> >
> > This may be called up to 12000 times in one "Save". Hence
> > currently extremely slow. I am looking to speed this up andhave
> > tried the followingRepeatReason;
> >
> > While not Dataset.eof do begin
> > { does not load activities which have been repeated }
> > Dataset.Edit;
> > Dataset.FieldByName('WS_REPEAT_REASON').AsString :=
> > Dataset.Post;records that
> > Dataset.Next;
> > break;
> > end;
> >
> > In this case "Dataset" is a TIB_Cursor containing all the
> > need to be modified. The trouble is this code doesn't seem tomodify
> > the records in the db. Can anyone help please?Why wouldn't the OP just let the server do it all (or am I missing
> >
something)? From his attempt at speeding things up, WS_REPEAT_REASON
is the same for all of the records referenced by Dataset. So
wouldn't it be possible to just execute something like this:
UPDATE <table> SET WS_REPEAT_REASON = :ACTIVITY_ID
WHERE <whatever criteria were used in the first place>
using a TIB_Query or a TIB_Statement?
Michael D. Spence
Mockingbird Data Systems, Inc.