Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 Manual for RAD Studio XE5 (C++ MacOS32) » Using ElevateDB » Executing Queries |
{ MyDatabase->DatabaseName="AccountingDB"; MyDatabase->Database="Accounting"; MyDatabase->Connected=true; MyQuery->DatabaseName="AccountingDB"; MyQuery->SQL->Clear(); MyQuery->SQL->Add("SELECT * FROM ledger"); MyQuery->Active=true; }
{ MySession->SessionName="Remote"; MySession->SessionType=stRemote; MySession->RemoteAddress="192.168.0.2"; MySession->Active=true; MyQuery->SessionName="Remote"; MyQuery->DatabaseName="Accounting"; MyQuery->SQL->Clear(); MyQuery->SQL->Add("SELECT * FROM ledger"); MyQuery->Active=true; }
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". |
{ MyDatabase->DatabaseName="AccountingDB"; MyDatabase->Database="Accounting"; MyDatabase->Connected=true; MyQuery->DatabaseName="AccountingDB"; MyQuery->SQL->Clear(); MyQuery->SQL->Add("UPDATE ledger SET AccountNo=100"); MyQuery->SQL->Add("WHERE AccountNo=300"); MyQuery->ExecSQL(); }
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. |
{ MyDatabase->DatabaseName="AccountingDB"; MyDatabase->Database="Accounting"; MyDatabase->Connected=true; MyQuery->DatabaseName="AccountingDB"; MyQuery->SQL->Clear(); MyQuery->SQL->Add("UPDATE ledger SET AccountNo=100"); MyQuery->SQL->Add("WHERE AccountNo=300"); MyQuery->ExecSQL(); ShowMessage(IntToStr(MyQuery->RowsAffected)+ " rows updated in "+ FloatToStr(MyQuery->ExecutionTime)+" seconds"); }
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 |