Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 Manual for RAD Studio XE8 (C++ MacOS32) » Using ElevateDB » Parameterized Queries |
SELECT Last_Name, First_Name FROM Customer WHERE (Last_Name=:LName) AND (First_Name=:FName)
UPDATE Orders SET ItemsTotal = :TotalParam WHERE (OrderNo = 1014)
{ MyQuery->SQL->Clear(); MyQuery->SQL->Add("INSERT INTO Country (Name, Capital, Population)"); MyQuery->SQL->Add("VALUES (:Name, :Capital, :Population)"); MyQuery->Params[0]->AsString="Lichtenstein"; MyQuery->Params[1]->AsString="Vaduz"; MyQuery->Params[2]->AsInteger=420000; MyQuery->ExecSQL(); }
{ MyQuery->SQL->Clear(); MyQuery->SQL->Add("SELECT *"); MyQuery->SQL->Add("FROM Orders"); MyQuery->SQL->Add("WHERE CustID = :CustID"); MyQuery->ParamByName("CustID")->AsFloat=1221; MyQuery->Open(); end;
{ MyQuery->SQL->Clear(); MyQuery->SQL.Add("INSERT INTO Customer (CustNo, Company"); MyQuery->SQL.Add("VALUES (:CustNo, :Company)"); // Manually prepare the query MyQuery->Prepare(); MyQuery->ParamByName("CustNo")->AsInteger=1000; MyQuery->ParamByName("Company")->AsString="Chocolates, Inc."; MyQuery->ExecSQL(); MyQuery->ParamByName("CustNo")->AsInteger=2000; MyQuery->ParamByName("Company")->AsString="Flowers, Inc."; MyQuery->ExecSQL(); MyQuery->ParamByName("CustNo")->AsInteger=3000; MyQuery->ParamByName("Company")->AsString="Candies, Inc."; MyQuery->ExecSQL(); }
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |