PL SQL Program For invoice.
declare
no invoices.invno %type;
actsale invoices.actualsales %type;
ts invoices.targetsales %type;
err exception;
begin
no:=&no;
actsale:=&actsale;
ts:=&ts;
if(actsale-ts <=0) then
raise err;
else
insert into invoices(invno,actualsales,targetsales)
values(no,actsale,ts);
dbms_output.put_line('Commission '||(actsale-ts)*.25||' paid and record added sucessfully');
end if;
exception
when err then
dbms_output.put_line('ACTUAL SALES SHOULD BE GREATER THAN TARGET SALES');
end;
0 comments:
Post a Comment