Board index » delphi » Updated failed Error with cached updates and persistent fields

Updated failed Error with cached updates and persistent fields

Hi,

Delphi 4.03, Oracle8.0.51

I'm using a query dataset with an updateSQL object.

I get an "EDatabaseError Updated failed" when I call
ApplyUpdates to the query dataset,

-- when I add fields with the field editor for the query dataset.

-- Without using those explicit TField objects everthing works fine...

Can anyone help me?

Thanks
  Helmut

 

Re:Updated failed Error with cached updates and persistent fields


I have done the same without trouble.
Apparently you get that msg if the VCL thinks there was not one row updated.
When I did get that msg, it was due to putting the SQL in a begin/end block.
Russell Smith gave me  a workround, but I doubt it applies to your case.

Re:Updated failed Error with cached updates and persistent fields


I made nothing special ...

  - one simple query dataset  "select * from aTable"
  - no special Oracle datatypes
  - used standard SQL-commands within the UpdateSQL
    component. Update via key fields.

but I cannot see why it diddn't work and I get the error

"Updated failed"

regards
   Helmut

Re:Updated failed Error with cached updates and persistent fields


Helmut Pasch wrote.

Quote
> I made nothing special ...

>   - one simple query dataset  "select * from aTable"
>   - no special Oracle datatypes
>   - used standard SQL-commands within the UpdateSQL
>     component. Update via key fields.

> but I cannot see why it diddn't work and I get the error

> "Updated failed"

Perhaps, RowsAffected in TUpdateSQL.ExecSQL indicates 0 or over 1.

DBTables.pas

procedure TUpdateSQL.ExecSQL(UpdateKind: TUpdateKind);
begin
  with Query[UpdateKind] do
  begin
    Prepare;
    ExecSQL;
    *** Try to check the RowsAffected at this point. ***
    if RowsAffected <> 1 then DatabaseError(SUpdateFailed);
  end;
end;

---
Rika

Other Threads