![]() | Products |
| Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 Manual for RAD Studio XE (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 Tuesday, September 16, 2025 at 04:56 PM | Privacy Policy © 2026 Elevate Software, Inc. All Rights Reserved Questions or comments ? |

