Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 Manual for RAD Studio 2007 (Delphi) » Using ElevateDB » Executing Queries |
begin with MyDatabase do begin DatabaseName:='AccountingDB'; Database:='Accounting'; Connected:=True; end; with MyQuery do begin DatabaseName:='AccountingDB'; SQL.Clear; SQL.Add('SELECT * FROM ledger'); Active:=True; end; end;
begin with MySession do begin SessionName:='Remote'; SessionType:=stRemote; RemoteAddress:='192.168.0.2'; Active:=True; end; with MyQuery do begin SessionName:='Remote'; DatabaseName:='Accounting'; SQL.Clear; SQL.Add('SELECT * FROM ledger'); Active:=True; end; end;
Pete's Garage
MyEDBQuery.SQL.Text:='INSERT INTO MyTable '+ '(MyVarCharColumn) VALUES ('+ Engine.QuotedSQLStr(MyEdit.Text)+')';
Method | Usage |
ExecSQL | Use this method when the SQL statement specified in the SQL property may or may not return a result set. The ExecSQL method can handle both situations. |
Open | Use this method only when you know that the SQL statement specified in the SQL property will return a result set. Using the Open method with an SQL statement that does not return a result set will result in an EDatabaseError exception being raised with an error message "Error creating table handle". |
begin with MyDatabase do begin DatabaseName:='AccountingDB'; Database:='Accounting'; Connected:=True; end; with MyQuery do begin DatabaseName:='AccountingDB'; SQL.Clear; SQL.Add('UPDATE ledger SET AccountNo=100'); SQL.Add('WHERE AccountNo=300'); ExecSQL; end; end;
Property | Description |
SQLStatementType | Indicates the type of SQL statement currently ready for execution. |
Property | Description |
Plan | Contains information about how the current query was executed, including any optimizations performed by ElevateDB. This information is very useful in determining how to optimize a query further or to simply figure out what ElevateDB is doing behind the scenes. The Plan property is automatically cleared before each execution of an SQL statement. |
RowsAffected | Indicates the number of rows affected by the current query. |
ExecutionTime | Indicates the amount of execution time in seconds consumed by the current query. |
ExecutionResult | Indicates the Boolean result of the current SQL execution. |
Sensitive | Indicates the whether the result set cursor for the query is sensitive or insensitive. Please see the Result Set Cursor Sensitivity topic for more information. |
begin with MyDatabase do begin DatabaseName:='AccountingDB'; Database:='Accounting'; Connected:=True; end; with MyQuery do begin DatabaseName:='AccountingDB'; SQL.Clear; SQL.Add('UPDATE ledger SET AccountNo=100'); SQL.Add('WHERE AccountNo=300'); ExecSQL; ShowMessage(IntToStr(RowsAffected)+ ' rows updated in '+ FloatToStr(ExecutionTime)+' seconds'); end; end;
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 |