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
Operator Precedence The operations within an expression are completed in a particular order depending on their precedence (priority). The table shows the default order of the op

Use Serially Reusable Packages To help you to manage the use of memory, the PL/SQL gives the pragma SERIALLY_ REUSABLE that mark some packages as serially reusable . So mark

INSERT Command in SQL Loosely speaking, INSERT takes the rows of a given source table and adds them to the specified target table, retaining all the existing rows in the targ

Keyword & Parameter Description: WHEN: This keyword introduces the exception handler. You can have many exceptions execute the similar sequence of the statements by follo

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. T

BETWEEN and NOT BETWEEN Operator in SQL Example: Restricting exam marks to between 0 and 100 CREATE ASSERTION Marks_between_0_and_100 CHECK (NOT EXISTS (SELECT * FROM

Using NOT NULL Besides assigning an initial value, the declarations can impose the NOT NULL constraint, as the example below shows: acct_id INTEGER(4) NOT NULL := 9999; You ca

Parameter and Keyword Description: package_name: This construct identifies the package. AUTHID Clause: This determine whether all the packaged subprograms impleme

FETCH Statement The FETCH statement retrieve rows of data one at a time from the result set of the multi-row query. The data is stored in fields or variables which correspond t

Comparison Operators The Comparison operators can compare one expression to another. The outcome is always true, false, or null. Usually, you use a comparison operators in condi