Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 Manual for RAD Studio XE8 (Delphi MacOS32) » Using ElevateDB » Executing Scripts |
begin with MyDatabase do begin DatabaseName:='AccountingDB'; Database:='Accounting'; Connected:=True; end; with MyScript do begin DatabaseName:='AccountingDB'; SQL.LoadFromFile('c:\scripts\GetLedgerEntries.sql'); Active:=True; end; end;
begin with MySession do begin SessionName:='Remote'; SessionType:=stRemote; RemoteAddress:='192.168.0.2'; Active:=True; end; with MyScript do begin SessionName:='Remote'; DatabaseName:='Accounting'; SQL.Clear; SQL.Add('SCRIPT ()'); SQL.Add('BEGIN'); SQL.Add(' EXECUTE IMMEDIATE ''BACKUP DATABASE Test '); SQL.Add(' AS TestBackup TO STORE "Backups" '); SQL.Add(' INCLUDE CATALOG'';'); SQL.Add('END'); ExecScript; end; end;
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". |
begin with MyDatabase do begin DatabaseName:='AccountingDB'; Database:='Accounting'; Connected:=True; end; with MyScript do begin DatabaseName:='AccountingDB'; SQL.LoadFromFile('UpdateLedgerEntries.SQL'); Prepare; ParamByName('AccountNo').AsString:='00100'; ExecScript; 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 |