C++

Secrets Of FireDac: Last Inserted Auto Generated Id And Enterprise Connectors

A common pattern when inserting data into a database table which has an auto increment field set on it is to use an SQL query to select the last inserted ID of the newly created record. Once you use your TFDQuery to run your INSERT query you can run this second query to get the newly inserted auto increment ID. Different databases have different SQL queries to accomplish this. MySQL for example…
Read more
Delphi

Upload An Attachment To SalesForce With The Delphi 10.2 Tokyo Enterprise Connectors

I am working on a project that utilizes the Embarcadero Enterprise Connectors powered by CData to access SalesForce through it’s API. The Enterprise Connectors provide you a wide variety of connectors for quickly and easily accessing APIs like SalesForce, Google AdWords, Mailchimp, Facebook, Azure, YouTube, and many many more. The Enterprise Connectors work through FireDAC and give you an…
Read more
C++

Secrets Of FireDAC: Dynamic Where Clause Using Conditional Substitution Macros

If you are using FireDAC and building your SQL queries manually you may be using more verbose code than is needed. FireDAC has a feature called Macros which allows you to do a variable substitution in your SQL query similar to parameter substitution but for raw SQL. However, in addition to macro substitution you can combine it with conditional substitutions which lets you do the real magic. If you…
Read more