I’m using Sql Developer and Oracle.
I need to implement a system in a database so that Once a customer has had their supply cut off, the person or business responsible for
the bill will not be able to create a new account at a different service address until
such time as their arrears have been cleared. This needs to be implemented using either a Trigger or a Stored Procedure.
Here is what i have attempted
create or replace PROCEDURE NONEWACCOUNT(newcustomerID in number,
newStatus in varchar)
AS
begin
select
from a2_watermeter
where customerid = newcustomerid and Status = newStatus;
if (newStatus = 'Inactive') then
DBMS_OUTPUT.put_line('Can not make new account as customer has to pay his/or account');
end if;
end;
Below is my database.
But as I am completely new to sql, I have no clue what to change
Cheers to anyone who can shed some light on this.
My database
a2_METERREADER
- EMPLOYEEID
- FIRSTNAME
- LASTNAME
a2_READING
- READINGID
- METERID
- EMPLOYEEID
- BILLNUMBER
- READING
- DATERECORD
a2_Watermeter
- METERID
- ADDRESS
- SUBURB
- POSTCODE
- STATUS
- CUSTOMERID
- REPLACE
- INSTALLDATE
a2_customer
- customerid
- firstname
- lastname
- address
- suburb
- postcode
- email
- phone
- businessname
- dateofbirth
a2_bill
- billnumber
- address
- suburb
- postcode
- customerid
- readingid
- amount
- reading
- firstname
- lastname
- paid
- duedate
1 Answer