1 Reply Latest reply on May 3, 2013 5:06 PM by InoL

    please help me with this

      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)
      if length(passwd) <> 6,
      raise_application_error(20001,'password length not correct');

      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.