Implement a new discount for return shoppers, PL-SQL Programming

Brewbean's is implementing a new discount for return shoppers - every fifth completed order receives a 10% discount. The count of orders for a shopper is placed in a packaged variable named PV_DISC_NUM during the ordering process. This count needs to be tested upon checkout to determine if a discount should be applied. Create a trigger named BB_DISCOUNT_TRG so that when an order is confirmed (the ORDERPLACED value is set from 0 to 1), the PV_DISC_NUM packaged variable is checked. If it is equal to 5, then set a second packaged variable named PV_DISC_TXT to 'Y'. This variable is used in calculating the order summary so that a discount is applied if appropriate.

Create a package specification named DISC_PKG that contains the needed packaged variables. Use an anonymous block to initialize the packaged variables to use for testing the trigger. Test the trigger by using the following update statement:

Update bb_basket set orderplaced =1 where idbasket=13;

Reset the ORDERPLACED to zero for the basket used (this is done as needed to complete trigger testing). Also, disable this trigger when completed so that it does not affect other assignment questions.

Posted Date: 3/12/2013 2:08:02 AM | Location : United States







Related Discussions:- Implement a new discount for return shoppers, Assignment Help, Ask Question on Implement a new discount for return shoppers, Get Answer, Expert's Help, Implement a new discount for return shoppers Discussions

Write discussion on Implement a new discount for return shoppers
Your posts are moderated
Related Questions
PPD , CPA, Filesharing Site Project Description: This is very easy I need a PPD , CPA, Filesharing Site. [PPD] stands for (pay per download) example hotsharecash [Files

Question: (a) In the context of database security explain how the following database features help to enforce security in the database system: (i) Authorisation (ii) Access


Write a pl/sql block that declares and uses cursors with parameters. In a loop, use a cursor to retrieve the department number and the department name from the departments table

IN Mode An IN parameter pass the values to the subprogram being called. Within the subprogram, an IN parameter acts like a constant. And hence, it cannot be assigned a value.

Implicit Cursor Attributes The Implicit cursor attributes returns the information about the execution of an INSERT, DELETE, UPDATE, or SELECT INTO statement. The cursor attribu

Some Varray Examples In SQL Plus, assume that you define an object type Project, as described below: SQL> CREATE TYPE Project AS OBJECT ( 2 project_no NUMBER(2), 3 title VARCHA

What Are Cursor Variables  ? The Cursor variables are like C or Pascal pointers that hold the memory location (address) of some item rather of the item itself. Therefore, decl

Cause of Indeterminacy in SQL One root cause of indeterminacy in SQL lies in its implementation of comparison for equality. For certain system-defined types it is possible for

ROWID The ROWID returns the rowid (binary address) of a row in the database table. You can use the variables of the type UROWID to store rowids in a readable format. In the il