ODAC

TOraSQL.Params Property

Contains the parameters for a SQL statement.

Class

TOraSQL

Syntax

property Params: TOraParams stored False;

Remarks

Contains the parameters for a SQL statement.

Access Params at runtime to view and set parameter names, values, and data types dynamically (at design time use the Parameters editor to set parameter information). Params is a zero-based array of parameter records. Index specifies the array element to access.

An easier way to set and retrieve parameter values when the name of each parameter is known is to call ParamByName.

Example

Setting parameters in runtime.

procedure TForm1.Button1Click(Sender: TObject);
begin
with OraSQL do
begin
  SQL.Clear;
  SQL.Add('INSERT INTO Temp_Table(Id, Name)');
  SQL.Add('VALUES (:id, :Name)');
  ParamByName('Id').AsInteger := 55;
  Params[1].AsString := ' Green';
  Execute;
end;
end; 

See Also

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback