TAstaClientDataSet.ExecSQLWithParams
Applies to
TAstaClientDataSet
Declaration
procedure ExecSQLWithtParams(S: string);
Description
This allows you to execute insert statements with binary and memo fields. Use this if you don't want
to change the SQL of your select statement.
The following example is taken from the ExecSQLParam tutorial.
with NameDataSet do begin
Params.Clear;
//FastAdd adds a parameter and tries to set the data type according to the input
//the first three come in as text, integer, datetime
Params.FastAdd(Edit1.Text);
Params.FastAdd(2);
Params.FastAdd(Now);
//the memo needs to be created explicitly
Params.CreateParam(ftmemo, 'Description', ptInput);
ParamByName('Description').AsMemo := Memo1.Text;
Params.FastAdd(Time);
//this shows how to send a paramerized update statement
ExecSQLWithParams('Update Events Set Event_Name = :A, VenueNo = :B,
Event_Date = :C, Event_Description =:D, Event_Time = :E Where EventNo = 1');
Close;
Open;
end;