| 20080288555 | Enforcing constraints from a parent table to a child table - An apparatus, system, and storage medium that, in an embodiment, receive a constraint command that specifies a parent table, a primary key in the parent table, a child table, and a foreign key in the child table, and enforce that all values for the primary key in the parent table are present in the foreign key in the child table. In an embodiment, the enforcing may include receiving an insert command that specifies a target key, a target value for the target key, and a target table; determining whether the target table matches the parent table and whether, within a transaction that includes the insert command, the child table includes at least one row with a foreign key value that equals the target value of the primary key; inserting the target value in the target table if the determining is true; and returning an error otherwise. | 11-20-2008 |
| 20090055418 | AUTOMATIC CASCADING COPY OPERATIONS IN A DATABASE WITH REFERENTIAL INTEGRITY - A method and apparatus for performing a cascading copy operation in a database with referential integrity constraints is disclosed. A user may supply (or be prompted to provide) a new key value, a first table, and a primary key value to use in the cascading copy operation. In response, a database engine may be configured to create a new record in the first table, with a primary key equal to the new key value supplied to the cascading copy operation and otherwise duplicate data values from the row identified by the primary key value. The database engine may also duplicate records in the database in tables other than the first table. Specifically, in one embodiment, records in any table that use the primary key value supplied to the cascading copy operation as a foreign key may be duplicated as a new record having the new key value as the foreign key. | 02-26-2009 |