EasyTable: Single-File Embedded Database,
a BDE replacement for Delphi and C++Builder



Using parameters
Previous  Top  Next


Parameters can be used for replacing data values in SQL statements. Parameters are identified by a preceding colon (:).
You can use parameters with SELECT, INSERT, UPDATE or DELETE statements. Here are some examples how you can use parameters:

With EasyQuery1 do
begin
SQL.Clear;
SQL.Add('INSERT INTO customer_Sort (Company,Address,CustNo)');
SQL.Add('VALUES (:Company, :Address, :CustNo)');
Params[0].AsString := 'AidAim Software';
Params[1].AsString := 'US';
Params[2].AsInteger := 4;
ExecSQL;
end;

With EasyQuery1 do
begin
SQL.Clear;
SQL.Add('SELECT * FROM orders WHERE PaymentMethod = :PayMethod ');
ParamByName('PayMethod').AsString := 'Visa';
Open;
end;


© AidAim Software EasyTable: