Maintain an audit trail of product table changes, PL-SQL Programming

The accuracy of product table data is critical and the Brwebean's. owner wants to have an audit file that contains information regarding all DML activity on the BB_PRODUCT table. This information should indicate the user id of the user running a DML statement, the date, the original values of the changed rows and the new values. The audit table needs to track specific columns of concern, including PRODUCTNAME, PRICE, SALESTART, SALEEND, and SALEPRICE. Create a table named BB_PRODCHG_AUDIT that can hold the relevant data. Then create a trigger named BB_AUDIT_TRG that fires on update to this table whenever one of the specified columns in the BB_PRODUCT table is changed.

Use the following update statement to test your trigger. Then, complete a rollback and disable the trigger when completed so that it does not affect other assignment questions.

Update bb_product set salestart = '05-MAY-03', saleend = '12-MAY-03', saleprice = 9 where idproduct = 10;

Posted Date: 3/12/2013 2:09:11 AM | Location : United States

Related Discussions:- Maintain an audit trail of product table changes, Assignment Help, Ask Question on Maintain an audit trail of product table changes, Get Answer, Expert's Help, Maintain an audit trail of product table changes Discussions

Write discussion on Maintain an audit trail of product table changes
Your posts are moderated
Related Questions
Using TRIM This process has two forms. The TRIM removes an element from the end of the collection. The TRIM(n) removes the n elements from the end of the collection. For e.g.


Datatype Conversion At times it is necessary to convert a value from one datatype to another. For e.g. if you want to inspect a rowid, you should convert it to a character stri

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a trigger that automatically updates the stock level of all pr

Using Invoker Rights: By default, the stored procedure executes with the privileges of its definer, not its invoker. These procedures are bound to the schema in which they inh

THEO R Y OF ETERNITY OF LIFE (PRAYER - 1880) - The theory of eternity of life, also called the steady-state theory , states that life has ever been in existence as at presen

Question: (a) The objective of query optimization is to choose the most efficient strategy for implementing a given relational query, thereby improving the system performance. On

Package Specification The package specifications contain the public declarations. The scopes of these declarations are local to your database representation and global to the

Creating a Table Syantax: CREATE TABLE ENROLMENT (StudentId SID, Name   VARCHAR (30) NOT NULL, CourseId CID, PRIMARY KEY (StudentId, CourseId)) ; Explan

Scope Rules You cannot declare an exception twice in the similar block. Though, you can, declare the similar exception in 2 different blocks. The Exceptions declared in a bloc