摘要 |
<p>A method and a device for realizing the function of database trigger are disclosed. The method includes the following steps: registering a table-level trigger (S101); obtaining a table record, which is needed to be loaded, from a file, when the file is needed to be added to the database, and comparing the obtained table record with a table record in the database (S102); updating the database when there is variation in the obtained table record, and distributing a message about variety of the table in the database according to the registered table-level trigger (S103). A function of triggering in table unit and informing an application module of the data in the database being varied is realized. The method enriches the function of database trigger, satisfies the application requirement of table-level triggering, saves the processing time of the trigger by the database, and enhances the efficiency of the data real-time synchronization at the foreground.</p> |