Board index » delphi » Oracle---BDE 5.2---Delphi 5 Ent.

Oracle---BDE 5.2---Delphi 5 Ent.

As i develop an application in D5 together with Oracle 8i as database i have
now the problem that it doesn't want to update fields in an table through
the Updatesql component. The first time i start with
DATABASE.STARTTRANSACTION, then i open an Tquery which is connected to an
Tupdatesql component. The first time before i do the first APPLYUPDATES all
goes well, i can update existing data and enter new data in existing EMPTY
fields.....
Then i do the first APPLYUPDATES . After that i can change still all
existing data but what i cannot do is putting new data in existing EMPTY
fields......!!! What do i do wrong and has this got to do with the BDE or
with ORACLE?

Please help me if anybody has any clues...................
--

--
***************************************
Andr Groeneveld
The Netherlands
***************************************

 

Re:Oracle---BDE 5.2---Delphi 5 Ent.


- Set Query.CachedUpdates to True
- Set Query.RequestLive to False
- Set Query.UpdateObject to a TUpdateSQL object
- Make sure the queries in TUpdateSQL are correct.
- Write the following AfterPost and AfterDelete events

procedure TForm1.Query1AfterPostOrDelete(DataSet: TDataSet);
begin
  with Dataset as TDBDataset do
    if CachedUpdates and UpdatesPending then
    try
      Database.ApplyUpdates([TDBDataset(Dataset)])
    except
      CancelUpdates;
    end;
end;

ps. There is a 'bug' in TUpdateSQL. Updating or deleting a record will fail
if one of the key fields is NULL.

Quote
"Andr" <Recreatie_dui...@hotmail.com> wrote in message

news:yMtj8.80573$hK4.8097724@amsnews02.chello.com...
Quote
> As i develop an application in D5 together with Oracle 8i as database i
have
> now the problem that it doesn't want to update fields in an table through
> the Updatesql component. The first time i start with
> DATABASE.STARTTRANSACTION, then i open an Tquery which is connected to an
> Tupdatesql component. The first time before i do the first APPLYUPDATES
all
> goes well, i can update existing data and enter new data in existing EMPTY
> fields.....
> Then i do the first APPLYUPDATES . After that i can change still all
> existing data but what i cannot do is putting new data in existing EMPTY
> fields......!!! What do i do wrong and has this got to do with the BDE or
> with ORACLE?

> Please help me if anybody has any clues...................
> --

> --
> ***************************************
> Andr Groeneveld
> The Netherlands
> ***************************************

Other Threads