TOraQuery, additional parameters during INSERT

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
aparvis
Posts: 3
Joined: Mon 22 Nov 2010 10:11

TOraQuery, additional parameters during INSERT

Post by aparvis » Tue 12 Feb 2013 12:24

Hi

Is it possible to pass parameter other than column name during INSERT into database table via TOraQuery? I used 'SQL Generator' (one of sheets of TOraQuery Editor) to prepare stored procedures for INSERT, UPDATE, etc. where all parameters equal column names in database table. When I tried to add another parameter to these stored procedures, then during execution I received error 'Project raised exception class EDatabaseError with message 'Not found field corresponding parameter''. Maybe it's possible somehow via TUpdateSQL + TOraSQL.

I use ODAC 8.1.4.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TOraQuery, additional parameters during INSERT

Post by AlexP » Tue 12 Feb 2013 14:18

Hello,

You can set parameter values, which names are absent/mismatch in the query field list in the OraQuery.BeforeUpdateExecute method, for example:

Code: Select all

procedure TForm1.OraQuery1BeforeUpdateExecute(Sender: TDataSet;
  StatementTypes: TStatementTypes; Params: TDAParams);
begin
  Params.ParamByName('non_existent_parameter').AsInteger := 10;
end;

Post Reply