Trigger updating same table oracle

24-May-2017 16:46

The order-order item structure is perfectly fine on each individual machine – my order object references two order item objects that exist it’s memory space, your order object references three order item objects that exist in its memory space, and the three rows in the Order Item table all include a foreign key to the row in the Order table representing the order.

When you look at it from the point of view of the entities, the order and its order items, there is an RI problem because my order object doesn’t refer to order item C.

A similar situation would occur if you had deleted order item B – now my order object would refer to an order item that no longer exists.

This assumes of course that the database is the system of record for these entities.

In relational database design the referential integrity rule (Halpin 2001) states that each non-null value of a foreign key must match the value of some primary key.

In the 1970s, when relational databases first came on the scene, the standard implementation technology was procedural languages such as PL/1, Fortran, and COBOL.

When something is changed in the system of record it’s considered an “official” change. When the same entities are stored in several databases you have the exact same referential integrity issues to deal with.

The fundamental issue is that whenever the same entities are represented in several schemas, regardless of whether they are data schemas or object schemas, you have the potential for “cross schema” referential integrity problems.

Keeping these various representations in sync is a concurrency control issue.The best way to look at it is that you now have options as to where referential integrity and business logic is implemented.This article explores the implications of this observation. The components of a new application may be deployed across several types of machines, including various client machines, web servers, application servers, and databases.I read an existing order and its order items into memory on my computer. Shortly thereafter you read the exact same order and order items into memory on your computer.

A database trigger helps the DBA ensure actions, such as updating an audit file, are completed regardless of which program or user makes data changes.… continue reading »

Read more

Hi Tom, From my knowledge of oracle, i understand that SELECT FOR UPDATE clause acquires row locks. In that case, if in a given table, when my query.… continue reading »

Read more

Pretty sure you have to do this with a trigger in Oracle create or replace TRIGGER parkedorder_tbiur BEFORE INSERT OR UPDATE ON parkedorder.… continue reading »

Read more

Referential integrity RI refers to the concept that if one entity references another then that other entity actually exists. For example, if I claim to.… continue reading »

Read more

Oracle Concepts - List of Oracle Event Codes. Oracle Tips by Burleson Consulting… continue reading »

Read more