US 12,405,947 B2
Statement-level instead-of database triggers
Abhijith Anilkumar, San Francisco, CA (US); Douglas Doole, Livermore, CA (US); Simon Y. Wong, San Carlos, CA (US); and Randy Philip Spalten, Benicia, CA (US)
Assigned to Salesforce, Inc., San Francisco, CA (US)
Filed by Salesforce, Inc., San Francisco, CA (US)
Filed on Jan. 31, 2024, as Appl. No. 18/428,583.
Prior Publication US 2025/0245217 A1, Jul. 31, 2025
Int. Cl. G06F 16/242 (2019.01); G06F 16/22 (2019.01); G06F 16/23 (2019.01); G06F 16/2455 (2019.01)
CPC G06F 16/2435 (2019.01) [G06F 16/2282 (2019.01); G06F 16/2365 (2019.01); G06F 16/2393 (2019.01); G06F 16/24565 (2019.01)] 20 Claims
OG exemplary drawing
 
1. A method, comprising:
storing, by a computer system, trigger information associated with a first statement-level database trigger executable to initiate execution of at least one first trigger instruction for a database instead of performing a particular database operation, on a first database view of selected data from the database, specified by a database operation statement;
receiving, by the computer system, a first database operation statement specifying performance of the particular database operation on the first database view;
identifying, by the computer system, a set of first target rows, within the first database view, targeted by the first database operation statement;
generating, by the computer system, a first reference table associated with the first database view, wherein the first reference table includes rows corresponding to the first target rows; and
executing, by the computer system, the first statement-level database trigger instead of executing, rather than before or after executing, the first database operation statement, wherein executing the first statement-level database trigger includes accessing the first reference table and wherein a single execution of the first statement-level database trigger is performed instead of execution of the first database operation statement for multiple of the first target rows.