Methods of DML
When you want to use DML in other programming languages, you need to connect to the database, and, depending on the language, you create your statements to manipulate the data you need. For example, in PHP, you need to connect to your database and write a query to update your data.
In Salesforce (Apex), we use some predefined statements that insert, update, delete, and recover data in the database. Because Apex is a data-focused language, we have direct access to the database. Let me give you an overview of all the DML statements in Apex, with the short version and the database version, including the result, as follows:
|
Action |
DML statement |
Database DML statement |
|
Insert records |
(void) insert records; |
(List<Database.SaveResult>) ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access