Tips and Frequently Asked Questions

  Executing SQL statements directly with IDBConnection


You might have some situations where you want to execute an SQL statement directly in the database, bypassing the object manager. Of course you could use the database access component directly (FireDac, dbExpress, ADO, etc.). But in case you want to keep the code abstract when it comes to the database access layer, and benefit from existing Aurelius connection, you can use IDBConnection to do so.

Here is how you would do it:

uses {...}, Aurelius.Drivers.Interfaces;

var
  Statement: IDBStatement;

Statement := Manager.Connection.CreateStatement;
Statement.SetSQLCommand(TheSQLStatement);
Statement.Execute;

If the statement is queryable, you can retrieve results using ExecuteQuery method which returns an IDBResultSet interface:

var
  Statement: IDBStatement;
  ResultSet: IDBResultSet;

Statement := Manager.Connection.CreateStatement;
Statement.SetSQLCommand(TheSQLStatement);
ResultSet := Statement.ExecuteQuery;

while ResultSet.Next do
  Value := ResultSet.GetFieldValue(SomeFieldName);

Finally, for both types of commands you can set parameter values:

{...}
Params := TObjectList<TDBParam>.Create;
try
  Statement := Manager.Connection.CreateStatement; 
  Params.Add(TDBParam.Create('id', ftInteger, 15));
  Statement.SetSQLCommand('Delete from Customer Where Id = :id');
  Statement.SetParams(Params);
  Statement.Execute;
finally
  Params.Free;
end;



Pricing

Single Developer License Small Team License Site License
 

TMS Aurelius


€ 190

60 yearly renewal
license for 1 developer


Includes
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
MOST POPULAR

TMS BIZ Premium


€ 595

180 yearly renewal
license for 1 developer


Includes
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
check  TMS Aurelius
check  All TMS BIZ products
more_horiz  Discover more
BEST VALUE

TMS ALL-ACCESS


€ 1,795

575 yearly renewal
license for 1 developer


Includes
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
check  TMS Aurelius
check  All TMS BIZ products
check  All TMS products
more_horiz  Discover more
All prices excl. VAT. Renewal price is subject to change and only valid up to 30 days after license has expired. After renewal period a discount price is offered to renew the license.

TMS ALL-ACCESS

key
Your unlimited access to all TMS products
local_offer
One money and time saving bundle

Free Trial

Start a free TMS Aurelius evaluation today!
RAD Studio

What our customers say

I am very happy to use TMS Aurelius with Delphi 10.4, I did not expect a quick launch like this. I am also enjoying the new BatchSize feature, which is much faster than the normal mode.

- Leandro

From what I've seen so far, I think this is going to revolutionize my app development - can't wait to start playing with the features now!

- Dave White

It's now very easy to build a report with the new Flexcel + Aurelius integration. It was so easy that I really thought I was doing something wrong. I will never go back to a report generator, Flexcel is way cooler and easier for reports.

- Eduardo Elias

TMS Aurelius makes my code to be very clean. I can code in pure OOP, not worrying about database persistence or SQL statements, being able to switch connections and database servers very easily. My development speed has increased significantly.

- Carlos Fitl

Wagner, I must congratulate with you: I really enjoy reading and watching your posts and videos about TMS Aurelius. First, I appreciate them because they are very specific and up to the point. Second, as a TMS Aurelius user, the more of your post I read, the more I am confident about the choice I have made between TMS Aurelius and "The Others". I love the simplicity of TMS Aurelius: this is the very distinctive trait of it: If you know how to deal with Plain Old Simple Object in Delphi, then you know 80% of TMS Aurelius. And your posts about it, are something I always find very interesting. Thank you so much.

- Fabio Vitale

TMS WEB Core

language
Create modern web apps in Delphi & VSC
build_circle
Use Object Pascal code to build JavaScript apps