Accuracer: The First And Only BDE Alternative
Client-Server Single-File Embedded Database for Delphi / C++Builder / Kylix



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 ACRQuery1 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 ACRQuery1 do
begin
SQL.Clear;
SQL.Add('SELECT * FROM orders WHERE PaymentMethod = :PayMethod ');
ParamByName('PayMethod').AsString := 'Visa';
Open;
end;


© AidAim Software Accuracer: Client-server Database Single-file Database Delphi Database Embedded Databas