System and method for constraint checking bulk data in a database
First Claim
1. In a relational database management system (RDMS) having a query compiler with a constraint engine and memory including mass storage for storing a database that has at least one table Ti containing a plurality of data records, each data record being uniquely identifiable in the RDMS, wherein the RDMS system further has a data processor for processing queries represented by a query graph, a method for checking for constraint violations in a data record in the table Ti, the method comprising the steps of:
- generating an insert query QMAIN for inserting one or more records into the table Ti ;
compiling the insert query QMAIN to produce compiled insert commands including insert code and checking code to check for constraint violations in one or more records specified by the insert query QMAIN ;
modifying the query QMAIN by replacing the insert code with compiled select commands to produce modified code having select code and the checking code; and
,constraint checking each record in the table Ti with the modified code.
1 Assignment
0 Petitions
Accused Products
Abstract
In a relational database management system (RDMS), a method and system for constraint checking of bulk data after storage in a base table. This invention generates a "dummy" INSERT inquiry to cause the compiler constraint rule engine to generate code for checking for constraint violations. After construction of a Query Graph Model by the compiler, a logic module replaces the INSERT inquiry with a SELECT inquiry to create code that when executed will select records from the bulk data table. Constraint violations are handled in several ways by this invention, including merely reporting that a constraint error exists or listing those records that violate constraint conditions. The logic also enforces referential integrity constraints by applying the SQL CASCADE command to the violating records to expand the violation list to include children records that would be orphaned when their parent records are later removed.
184 Citations
35 Claims
-
1. In a relational database management system (RDMS) having a query compiler with a constraint engine and memory including mass storage for storing a database that has at least one table Ti containing a plurality of data records, each data record being uniquely identifiable in the RDMS, wherein the RDMS system further has a data processor for processing queries represented by a query graph, a method for checking for constraint violations in a data record in the table Ti, the method comprising the steps of:
-
generating an insert query QMAIN for inserting one or more records into the table Ti ; compiling the insert query QMAIN to produce compiled insert commands including insert code and checking code to check for constraint violations in one or more records specified by the insert query QMAIN ; modifying the query QMAIN by replacing the insert code with compiled select commands to produce modified code having select code and the checking code; and
,constraint checking each record in the table Ti with the modified code. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. In a relational database management system (RDMS) having a compiler with a constraint engine and memory including mass storage, for storing a database that has at least one table Ti containing a plurality of data records, each data record being uniquely identifiable in the RDMS, wherein the RDMS system further has a data processor for processing queries represented by a query graph, and the RDMS system further includes an exception table Ei stored in memory, a method for checking for constraint violations in a data record in the table Ti, the method comprising the steps of:
-
generating an insert query QMAIN for inserting one or more records into the table Ti ; compiling the insert query QMAIN to produce compiled insert commands including insert code and checking code to check for constraint violations in one or more records specified by the insert query QMAIN ; modifying the query QMAIN by replacing the insert code with compiled select commands producing modified code having select code and the checking code thereby enabling constraint checking for each record in the table Ti, executing the modified code over the table Ti to report at least one constraint violation and to identify all the records in the table Ti that exhibit constraint violations in an error reporting data message; and constructing an insert command to place the error reporting message and any column entries of records exhibiting a constraint violation in the exception table Ei. - View Dependent Claims (16, 17)
-
-
18. A bulk-data constraint checking system in a relational database management system (RDMS) having memory including mass storage for storing a database that has at least one table Ti containing a plurality of data records, each data record being uniquely identifiable in the RDMS, wherein the RDMS system further has a data processor for processing queries represented by a query graph, the system comprising:
-
insert query generating means coupled to said data processor for generating an insert query QMAIN with one or more records to be inserted into the table Ti ; a constraint compiler with a constraint engine for compiling the insert query QMAIN to produce compiled insert commands including insert code and checking code to check for constraint violations in one more records specified by the insert query QMAIN ; query modifying means coupled with the data processor for modifying the query QMAIN by replacing the insert code with compiled select commands to produce modified code having select code and the checking code; and
,select and constraint checking command execution means coupled with the data processor for executing the modified code over the table Ti to report at least one constraint violation in an error reporting data message. - View Dependent Claims (19, 20, 21, 22, 23)
-
-
24. A database processing system comprising:
-
memory including a data store for storing at least one table Ti containing a plurality of data records, each data record being uniquely identifiable in the system; a data processor coupled to said data store for processing queries represented by query graphs; insert query generating means coupled to said data processor for generating an insert query QMAIN with one or more records to be inserted into the table Ti ; a constraint compiler with a constraint engine for compiling the insert query QMAIN to produce compiled insert commands including insert code and checking code generated by the compiler'"'"'s constraint engine to check for constraint violations in the records of the insert query QMAIN ; query modifying means coupled with the data processor for modifying the query QMAIN by replacing the insert code with compiled select commands to produce modified code having select code and the checking code generated by the compiler'"'"'s constraint engine; and
,select and constraint checking command execution means coupled with the data processor for executing the modified code over the table Ti to report at least one constraint violation in an error reporting data message. - View Dependent Claims (25, 26, 27, 28, 29)
-
-
30. A computer program product, for use with a relational database processing system having a compiler with a constraint engine and memory including mass storage, and also having a database stored in the mass storage that has at least one table Ti containing a plurality of data records, each data record being uniquely identifiable in the system, wherein the relational database processing system further has a data processor for processing queries represented by a query graph, a method for checking for constraint violations in a data record of the plurality of data records in the table Ti by using the compiler constraint engine, the computer program product comprising:
-
a recording medium; means, recorded on the recording medium, for directing the data processor to generate an insert query QMAIN with one or more records to be inserted into the table Ti ; means, recorded on the recording medium, for directing the compiler to compile the insert query QMAIN to produce compiled insert commands including insert code and checking code to check for constraint violations in one or more records specified by the insert query QMAIN ; means, recorded on the recording medium, for directing the data processor to modify the query QMAIN by replacing the insert code with compiled select commands to produce modified code having checking code generated by the compiler'"'"'s constraint engine; and
,means, recorded on the recording medium, for directing the data processor to execute the modified code over the table Ti to report at least one constraint violation in an error reporting data message. - View Dependent Claims (31, 32, 33, 34, 35)
-
Specification