Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 Manual for RAD Studio XE4 (C++ Win32) » Using ElevateDB » Executing Scripts |
{ MyDatabase->DatabaseName="AccountingDB"; MyDatabase->Database="Accounting"; MyDatabase->Connected=true; MyScript->DatabaseName="AccountingDB"; MyScript->SQL->LoadFromFile("c:\\scripts\\GetLedgerEntries.sql"); MyScript->Active=true; }
{ MySession->SessionName="Remote"; MySession->SessionType=stRemote; MySession->RemoteAddress="192.168.0.2"; MySession->Active=true; MyScript->SessionName="Remote"; MyScript->DatabaseName="Accounting"; MyScript->SQL->Clear(); MyScript->SQL->Add("SCRIPT ()"); MyScript->SQL->Add("BEGIN"); MyScript->SQL->Add(" EXECUTE IMMEDIATE 'BACKUP DATABASE Test "); MyScript->SQL->Add(" AS TestBackup TO STORE \"Backups\" "); MyScript->SQL->Add(" INCLUDE CATALOG';"); MyScript->SQL->Add("END"); MyScript->ExecScript(); }
Method | Usage |
ExecScript | Use this method when the script specified in the SQL property may or may not return a result set. The ExecScript method can handle both situations. |
Open | Use this method only when you know that the script specified in the SQL property will return a result set. Using the Open method with a script 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; MyScript->DatabaseName="AccountingDB"; MyScript->SQL->LoadFromFile("UpdateLedgerEntries.SQL"); MyScript->Prepare(); MyScript->ParamByName("AccountNo").AsString="00100"; MyScript->ExecScript(); }
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 |