This discussion is archived
1 Reply Latest reply: May 3, 2013 10:06 AM by InoL RSS

please help me with this

1002942 Newbie
Currently Being Moderated
Create a trigger called biufer_customer that starts before insert or update of the column passwd in the customer table. The trigger shall verify that the password is exactly six characters long, no more, no less. Unless this requirement is fulfilled, the trigger shall stop the transaction and confirm that this error occurred.

create or replace trigger biufer_customer
before insert or update of passwd on customer
for each row
when (new.passwd <> 6)
begin
if length(passwd) <> 6,
raise_application_error(20001,'password length not correct');
end;


Create a function called get_authority. This function takes two parameters (found in the account_owner table): cust_id and acc_id, and returns 1 (one), if the customer has the right to make withdrawals from the account, or 0 (zero), if the customer doesn't have any authority to the account.

When a customer transfers money from one account to another, use the function to check if the customer has authority to the account represented by the column from_acc_id in the transfer table.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points