TOraUpdateSQL

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

TOraUpdateSQL

Post by albourgz » Thu 14 May 2009 09:42

Dear all,

I have a TOraQuery with a TOraUpdateSQL.
The TOraQuery is closed (non active)
I would like to execute the delete statement of the TOraUpdateSQL.

To run
OraQuery->Params["ID"]->AsInteger=i;
The Delete statement has to be prepared for this, but how do I prepare only the delete statement (and run only the delete statement, not the update statement for example)?

Regards,
Alain

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 18 May 2009 08:04

You should call the Apply method of TOraUpdateSQL to execute a statement:

Code: Select all

  OraUpdateSQL->Apply(ukDelete);
To assing parameter values, use the BeforeUpdateExecute event of TOraQuery:

Code: Select all

procedure TForm1.OraQuery1BeforeUpdateExecute(Sender: TDataSet;
  StatementTypes: TStatementTypes; Params: TDAParams);
begin
  Params.ParamByName('ID').AsInteger := 1;
end;
In the current ODAC version you can use the Apply method only when TOraQuery is opened. In the next ODAC build we will fix this problem. So that the Apply method can be used when the query is closed.

Post Reply