Hello everybody,
I need your help to write the following procedure. I did it but dont get the out put so please help me that where I made mistake. I written the procedure just after the specification.
Write a program that computes a salesperson’s commission according to the specifications outlined below.
A particular company computes a salesperson’s weekly commission as follows:
If the salesperson sold less than or exactly equal to $ 500 in
products / services, then the salesperson’s commission rate
is 3.00
If the salesperson sold more than $ 500 but not more than $ 1,000 in products / services, then the salesperson’s commission rate
is 5.00
If the salesperson sold more than $ 1,000 in products / services,
then the salesperson’s commission rate is 10.00
To compute a salesperson’s commission, multiply the commission rate by his / her total sales.
************************************************
I WRITE DOWN AS UNDER.
set serveroutput on;
set verify off;
declare
sales number := &sales;
comm_rate number(5,2);
commission number(6,2);
begin
if sales <= 500
then comm_rate := 0.03;
else if sales <= 1000
then comm_rate := 0.05;
else
comm_rate := 0.10;
end if;
commission := comm_rate * sales;
dbms_output.put_line('Employees commission is' || commission);
End;
BUT ITS NOT WORKING . PLEASE LET ME KNOW WHERE I MADE MISTAKE.
Thank you.
Deven Oza