×

Method, system and computer program for inserting records into a database

  • US 7,860,845 B2
  • Filed: 07/23/2007
  • Issued: 12/28/2010
  • Est. Priority Date: 08/20/2004
  • Status: Active Grant
First Claim
Patent Images

1. A method for inserting received data into a database through a view constructed from a union of two or more base tables, the method implemented in a database management system to be operatively coupled to a data processing system having memory for storing the database, each base table having one or more constraints defining necessary conditions for at least one field of the data to meet for data to be inserted into the respective base table and including at least one before trigger operable to modify the data in a field before the insertion is performed, the method comprising the steps of:

  • for each field of the received data, adding a first column to the received data to each hold a copy of the original value of the field and copying the original values to the first column;

    adding a table identifier column to the received data to hold an identifier of a base table and setting the value of each row of the table identifier column to a predefined value;

    for each base table in turn, executing all before triggers defined for the base table on the received data and determining for each row of the received data if the values of the received data after the before triggers have been processed meet the identified constraints to insert the row of received data into the base table and, for each row;

    (a) if the identified constraints are met, determining if the table identifier column for that row has the predefined value and;

    (i) if it does not, marking the row with an error message indicating an ambiguous insert error and, (ii) if it does have the predefined value, then changing the value of the table identifier column to indicate the base table under consideration and copying the original value of each field from the first column to the respective field;

    or(b) if the identified constraints are not met, copying the original value of each field from the first column to the respective identified field ; and

    after all base tables have been considered, inserting each row of received data with an indication of a base table in the table identifier column into the indicated base table having first processed all before triggers defined for the indicated base table.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×